How to Send A Priority Message

Examples of how to send and forward priority messages to a user or group.

Send to a User

const message = await client.messages.sendToConversation(
'test message',
'sampleconversationid',
{
organizationId: 'some-org-id',
priority: client.enums.MessagePriority.HIGH
}
);
console.log('sent a ', message.priority, 'priority message');

Forward to a User

const forwardedMessage = await client.messages.forwardToUser(
'some-message-id',
'some-user-id-to-forward-to',
{
organizationId: 'some-org-id',
priority: client.enums.MessagePriority.HIGH
}
)
console.log(
'forwarded message to', forwardedMessage.counterParty.name,
'with priority of ', forwardedMessage.priority,
'original message from', forwardedMessage.originalSender.name
)

Send to a Group

const message = await client.messages.sendToGroupOfUsers(userIds, body, {
priority: client.enums.MessagePriority.HIGH
});
console.log('sent ', message.body, 'to ', message.group.displayName, 'with priority ', message.priority);

Forward to a Group

const forwardedMessage = await client.messages.forwardToGroup(
'some-message-id',
'some-group-id-to-forward-to',
{
priority: client.enums.MessagePriority.HIGH
}
)
console.log(
'forwarded message to ', forwardedMessage.counterParty.name,
'with priority of ', forwardedMessage.priority,
'original message from ', forwardedMessage.originalSender.name
)