Integrations
Slack
APIs
Send Message to User by Email

Send Message to User by Email

Send a user identified by email a Slack message.

For more information on the API for sending a message to a user by email, see users.lookupByEmail (opens in a new tab) and chat.postMessage (opens in a new tab).

SDK Import:

from admyral.actions import send_slack_message_to_user_by_email

Arguments:

Argument NameDescriptionRequired
Email emailAn email address belonging to a user in the Slack workspace.Yes
Text textThe purpose of this field changes depends on whether the blocks field is used. If blocks is used, this is used as a fallback string to display in notifications. If blocks is not used, this is the main body text of the message. It can be formatted as plain text, or with mrkdwn.-
Blocks blocksA JSON-based array of structured blocks (Example: [{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]). See here (opens in a new tab) for more information about blocks.-

Tip: Slack offers an online Block Kit Builder (opens in a new tab) to help you create blocks for your messages more easily.

Required Secrets

Secret PlaceholderDescription
SLACK_SECRETSlack secret. See Slack setup

SDK Example

user = send_slack_message_to_user_by_email(
	email="daniel@admyral.dev",
    text="Example slack message",
	secrets={
		"SLACK_SECRET": "my_stored_slack_secret"
	}
)