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

ParameterTypeDescription
messageIdstring|MessageA message ID or message object that is to be forwarded
distributionListIdstringDistribution list ID where that message should be forwarded
options?ObjectOptions (described below)

Options

ParameterTypeDescription
priority?stringIndicates priority level of message. Values: NORMAL (default), or HIGH
senderId?stringID 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
);