MessagingClientApiEvents

Messaging.MessagingClientApiEvents

Events

message.received

message.received(message): void

Emitted whenever a message is received. Your event handler receives a message object. Example:

const client = new Messaging.Client(...)
client.on('message.received', (message) => {
  console.log('Message received:', message)
  // message.from
  // message.to
  // message.body
  // ...
})

Parameters

NameTypeDescription
messageMessageContract

The message that has been received.

Returns

void


message.updated

message.updated(message): void

Emitted when the status of a message is updated. You can use this event to track the different stages that an outbound message goes through for delivery. Example:

const client = new Messaging.Client(...)
client.on('message.updated', (message) => {
  console.log('Message updated:', message)
  // message.from
  // message.to
  // message.direction
  // message.state
  // ...
})

client.send(...)

Parameters

NameTypeDescription
messageMessageContract

The message.

Returns

void