Skip to main content

SendResult

Relay.Messaging.SendResult

This object returned from send method that represents the result of a send operation.

Properties

PropertyTypeDescription
SuccessfulbooleanWhether the send operation has successfully queued the message.
MessageIdstringThe ID of the message.

Methods

GetMsgId

Returns the ID of the queued message (MessageId).

Parameters

None

Returns

string - Message ID.

Examples

Send a message and retrieve the ID.

/* just send a message using Send() with params */

resultSend := consumer.Client.Messaging.Send(from, to, context, "Hello again from Signalwire !")
if resultSend.GetSuccessful() {
signalwire.Log.Info("Msg Id: %s\n", resultSend.GetMsgId())
}

GetSuccessful

Return true if the message was queued, false otherwise.

Parameters

None

Returns

boolean - True/False accordingly to the state.

Examples

Send a message and then check if there was an error.

resultSend := consumer.Client.Messaging.Send(from, to, context, "Hello again from Signalwire !")
if !resultSend.GetSuccessful() {
signalwire.Log.Info("error while trying to send message")
}