.. _integrations:
Integrations
============
Welcome to the **MailTrigger Integrations** section! This is where MailTrigger comes alive — sending emails, pinging your **Telegram** group, dropping alerts in **Slack**, or even replying to users automatically.
.. note::
Each **Action** is what MailTrigger *does* when your rule matches an email. Use them to build powerful automations.
To better understand how actions work, see the :ref:`key-concept-action` section.
For each action, you’ll learn:
- **What it does**
- **How to configure it** (parameters)
.. contents:: **Available Actions**
:depth: 2
:local:
Chat & Messaging Notifications
------------------------------
.. _telegram-action:
Telegram Action
^^^^^^^^^^^^^^^^
.. raw:: html
Send real-time messages via Telegram Bot.
**Parameters**:
- ``botToken`` – Bot token from BotFather
- ``chatId`` – Chat or group ID
- ``body`` – Message (default: email body)
- ``title`` – Title (default: email subject)
.. note::
To obtain ``botToken`` and ``chatId``, see:
`Telegram integration guide `_ and
`Chat ID instructions `_
Discord Action
^^^^^^^^^^^^^^
.. raw:: html
Send rich notifications to Discord via webhook.
**Parameters**:
- ``webhookId`` – Discord webhook ID
- ``webhookToken`` – Discord webhook token
- ``botName`` *(optional)* – Bot display name
- ``body`` – Content
- ``title`` – Title
.. note::
To obtain ``webhookId`` and ``webhookToken``, see:
`Discord integration guide `_
Slack Action
^^^^^^^^^^^^
.. raw:: html
Post messages to a Slack channel via webhook or OAuth.
**Parameters**:
- ``webhookUrl`` *(optional)* – Incoming Webhook URL
- ``oAuthToken`` *(optional)* – Slack bot token
- ``channels`` – Target channels (e.g., ``#alerts``)
- ``body`` – Message
- ``title`` – Subject
.. note::
To obtain ``webhookUrl``, ``oAuthToken``, and ``channels``, see:
`Slack integration guide `_
LINE Action
^^^^^^^^^^^
.. raw:: html
Push messages to LINE users using your official LINE channel.
**Parameters**:
- ``token`` – Channel access token
- ``userId`` – LINE user ID(s)
- ``body`` – Message
- ``title`` – Subject
.. note::
To obtain ``token`` and ``userId``, see:
`LINE integration guide `_
Microsoft Teams Action
^^^^^^^^^^^^^^^^^^^^^^
.. raw:: html
Send notifications directly to Microsoft Teams via webhook.
**Parameters**:
- ``webhookUrl`` – Full Teams webhook URL
- ``body`` – Message
- ``title`` – Subject
.. note::
To obtain ``webhookUrl``, see:
`Microsoft Teams guide `_
WhatsApp Action
^^^^^^^^^^^^^^^
.. raw:: html
Send WhatsApp messages using Meta’s WhatsApp Cloud API.
**Parameters**:
- ``token`` – Meta access token
- ``from`` – From Phone ID (not a number)
- ``target`` – Target WhatsApp user
- ``template`` – WhatsApp template name
- ``body`` – Message
- ``title`` – Subject
.. note::
To obtain ``token``, ``from``, ``target``, and ``template``, see:
`WhatsApp integration guide `_
Core Email Actions
------------------
SMTP Action
^^^^^^^^^^^
.. raw:: html
Send emails using an external SMTP provider.
**Parameters**:
- ``smtp_server`` – SMTP host (e.g., ``smtp.gmail.com``)
- ``smtp_port`` – Port (commonly 587 or 465)
- ``smtp_tls`` – Use TLS (true/false)
- ``smtp_username`` – SMTP login
- ``smtp_password`` – SMTP password or app-specific password
- ``smtp_email`` *(optional)* – Sender email if different from login
- ``subject`` *(optional)* – Override email subject
- ``body`` *(optional)* – Override email body
Forward Action
^^^^^^^^^^^^^^
.. raw:: html
Repackages and forwards the email to another recipient.
.. note::
**SPF**: Add ``a:smtp.mailtrigger.app`` to your domain’s SPF record.
**DKIM**: Add the DKIM public key (provided in MailTrigger) to your domain’s DNS
to allow receiving servers to verify your messages.
**Parameters**:
- ``receivers`` – Comma-separated recipient addresses
- ``timeout`` – Connection timeout (default: 30s)
- ``subject`` *(optional)* – Override email subject
- ``body`` *(optional)* – Override email body
AutoRespond Action
^^^^^^^^^^^^^^^^^^
.. raw:: html
Automatically replies to the sender of a received email.
**Parameters**:
- ``subject`` – Subject of reply
- ``body`` – Content of reply
- ``smtp_server`` – SMTP host
- ``smtp_port`` – SMTP port
- ``smtp_tls`` – Use TLS
- ``smtp_username`` – SMTP login
- ``smtp_password`` – SMTP password
Relay Action
^^^^^^^^^^^^
.. raw:: html
Send email using MailTrigger’s built-in SMTP relay.
.. note::
**SPF**: Add ``a:smtp.mailtrigger.app`` to your domain’s SPF record.
**DKIM**: Add the DKIM public key (provided in MailTrigger) to your domain’s DNS
to allow receiving servers to verify your messages.
**Parameters**:
- ``timeout`` – SMTP connection timeout (default: 30s)
- ``subject`` *(optional)* – Override email subject
- ``body`` *(optional)* – Override email body
API Integration
---------------
API (Webhook) Action
^^^^^^^^^^^^^^^^^^^^
.. raw:: html
Trigger an external API with mail data as payload.
**Parameters**:
- ``method`` – HTTP verb (GET, POST, etc.)
- ``webhook_url`` – Target endpoint
- ``headers`` – JSON of headers
- ``data`` – JSON payload
- ``params`` – URL parameters
- ``timeout`` – Timeout in seconds (default: 10)
Automation & Intelligence
-------------------------
LLM Action
^^^^^^^^^^
.. raw:: html
Send the email to a large language model (LLM) for smart decisions.
**Parameters**:
- ``prompt`` – Prompt text for the model
- ``max_retry`` – Retry attempts (default: 10)
- ``temperature`` – Creativity (default: 1.0)
JavaScript Action
^^^^^^^^^^^^^^^^^
.. raw:: html
Run JavaScript to analyze or transform mail content.
**Parameters**:
- ``jsCode`` – JavaScript returning dict like ``{ attach: true/false, ... }``
WASM Action
^^^^^^^^^^^
.. raw:: html
Run a WebAssembly binary to fully customize mail behavior.
**Parameters**:
- ``wasm_parameter`` – JSON object passed to WASM runtime
----
Want to add your own action? Reach out to us or check our developer guide!