send_dm
Facts
Schema.slack.functions.SendDmslack#/functions/send_dmInput Parameters
Required Input Parameters
messageSchema.slack.types.rich_textRequiredThe textual message to send as a direct message
You've been swallowed by a grue.user_idSchema.slack.types.usergroup_idRequiredThe ID of the user to send a message to
U111AAA111Optional Input Parameters
interactive_blocksSchema.slack.types.blocksOptionalButtons to send with the message. Must be wrapped in a block.
metadataSchema.slack.types.objectOptionalAdditional metadata about the message, which can then be used an workflow event trigger.
thread_tsSchema.types.stringOptionalThe ts identifier of an existing message to send this message to as a reply.
1355517523.000005Output Parameters
Required Output Parameters
message_contextSchema.slack.types.message_contextRequiredAn individual instance of the message you sent
message_linkSchema.types.stringRequiredPermalink URL of the message that was sent
message_tsSchema.types.stringRequiredThe channel-specific unique identifier for this message, also serves as a confirmation that the message was sent.
Optional Output Parameters
actionSchema.types.objectOptionalIf interactive_blocks was provided, the action object contains the button properties (see action payload below)
interactivitySchema.slack.types.interactivityOptionalIf interactive_blocks is provided as an input parameter, the interactivity context becomes available
Usage info
Sends a message directly to a user, from your workflow.
If you include a button in the direct message, the function execution will not continue until an end user clicks on that button.
Example workflow step
const sendDmStep = ExampleWorkflow.addStep(
Schema.slack.functions.SendDm,
{
user_id: "U123ABC456",
message: "Don't give up. Never surrender.",
},
);
Example action payload
{
"action_id": "WaXA",
"block_id": "=qXel",
"text": {
"type": "plain_text",
"text": "View",
"emoji": true
},
"value": "click_me_123",
"type": "button",
"action_ts": "1548426417.840180"
}