Skip to content

Send Teams Message

The Send Teams Message node allows users to send a message to a Microsoft Teams user via their email address. This node integrates with Microsoft Graph and requires a configured Microsoft service account with permissions to send chat messages.

Description

Use this node to send a chat message directly to a user in Microsoft Teams, either as plain text or as an adaptive card (if JSON content is supplied and the toggle is enabled). It supports sending messages to yourself or to other users based on the provided email.


Inputs

LabelTypeDescriptionRequiredVisible When
Users EmailtextThe email address of the recipient Microsoft Teams user.*
MessagetextThe message to be sent. Can be plain text or JSON (if adaptive card is enabled).*
Pass Message as Adaptive Card JSONcheckboxIf checked, the message will be treated as Adaptive Card JSON and sent accordingly.*

Outputs

This node does not return an output value to downstream nodes. It sends the Teams message as a side effect.


Behavior

  • The node first validates that both Users Email and Message are provided.
  • Retrieves the configured Microsoft 365 service account using ThirdParty-Microsoft.
  • Sends a chat message using Microsoft Graph:
    • If the recipient email is the same as the service account (i.e., sending to self), a self-message is sent.
    • Otherwise, it sends the message to the specified email.
  • If the "Pass Message as Adaptive Card JSON" toggle is enabled and the message contains valid Adaptive Card JSON, it will be rendered as such in Teams.
  • If any step fails, the node returns a failure result with a descriptive error message.

Requirements

  • A valid Microsoft 365 service account must be configured and accessible via the ThirdParty-Microsoft input.
  • Appropriate Graph API permissions must be in place for chat message access (e.g., Chat.ReadWrite, User.Read).

Example Use Case

Send a welcome message to a new user when they are added to the system:

  • Users Email: newuser@company.com
  • Message: Welcome to the team! Let us know if you need any help.
  • Pass Message as Adaptive Card JSON: unchecked

Error Handling

ScenarioReturned StatusMessage
Missing Users EmailFail"Users Email is empty"
Missing MessageFail"Message is empty"
Microsoft Service Account not foundFail"Required Service Accounts not found"
Microsoft Graph call failsFail"Failed to send message to Teams"
User info cannot be retrievedFail"Failed to get user info/email"
Adaptive Card message invalid (runtime)Fail"Failed to Execute: ..."

Notes

  • Adaptive card rendering depends on Microsoft Teams capabilities. Ensure the JSON is valid and adheres to Adaptive Card schema standards.
  • This node modifies taskParameters.data by removing "Users Email" and "Message" after execution for data cleanliness.

Tentech 2024