messages.forwardToDistributionList()
This method allows you to forward a message to a Distribution List with or without priority.
Definition
client.messages.forwardToDistributionList(messageId: string|Object,distributionListId: string,options: ?Object)
Parameters
Parameter | Type | Description |
---|---|---|
messageId | string |Message | A message ID or message object that is to be forwarded |
distributionListId | string | Distribution list ID where that message should be forwarded |
options | ?Object | Options (described below) |
Options
Parameter | Type | Description |
---|---|---|
priority | ?string | Indicates priority level of message. Values: NORMAL (default), or HIGH |
senderId | ?string | ID of the user who is forwarding the message, default is current user |
Returns
An error will be thrown if the messageId
or distributionListId
are invalid.
Otherwise, once the returned Promise
is resolved, you will have a newly forwarded Message.
Example
Forward to distribution list with normal priority:
const forwardedMessage = await client.messages.forwardToDistributionList('some-message-id','some-distribution list-id-to-forward-to',{priority: client.enums.MessagePriority.NORMAL});console.log('forwarded message to', forwardedMessage.counterParty.name,'with priority of', forwardedMessage.priority,'original message from', forwardedMessage.originalSender.name);