SendResult

View as Markdown

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.

1/* just send a message using Send() with params */
2
3resultSend := consumer.Client.Messaging.Send(from, to, context, "Hello again from Signalwire !")
4if resultSend.GetSuccessful() {
5 signalwire.Log.Info("Msg Id: %s\n", resultSend.GetMsgId())
6}

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.

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