MailerSend
Send transactional email through MailerSend and track delivery — all from an InTouch job or the AI assistant. Send plain text, HTML, or a saved MailerSend template, then list and inspect the messages that have gone out to confirm they were delivered.
Grounded in the real MailerSend API:
- Base URL:
https://api.mailersend.com/v1 - Auth:
Authorization: Bearer <API token> - Headers:
Content-Type: application/json,Accept: application/json
This tool uses the Python standard library only (urllib, json) — no third-party packages.
Operations
operation |
Method & endpoint | What it does |
|---|---|---|
send-email |
POST /email |
Send a transactional email. |
list-messages |
GET /messages |
List recently sent messages (delivery tracking). |
get-message |
GET /messages/{messageId} |
Get one message's details. |
list-templates |
GET /templates |
List your email templates. |
get-template |
GET /templates/{templateId} |
Get one template's details. |
send-email
Required: to, plus at least one of text, html, or templateId.
fromEmail and subject are required unless a templateId supplies a default
sender/subject. fromEmail must be on a domain you have verified in MailerSend.
to/cc/bccaccept either a comma-separated list of bare emails ([email protected],[email protected]) or a JSON array of{"email": "...", "name": "..."}objects.tagsis a comma-separated list (max 5) for filtering/analytics.personalizationis a JSON array of per-recipient template variables, e.g.[{"email":"[email protected]","data":{"name":"Jane"}}].
MailerSend returns HTTP 202 Accepted with an empty body when a send is
queued; this tool reports status: "202" and an empty result object on success.
apiKey setup
- Sign in to the MailerSend dashboard.
- Verify a sending domain (Domains → add and verify DNS records).
- Go to Settings → API tokens → Generate new token, choose the scopes you need (at minimum Email for sending and Templates/Analytics for the read operations), and copy the token.
- Pass that token as the
apiKeyinput. It is sent asAuthorization: Bearer <token>. A single API token is all that is needed — there is no OAuth/JWT exchange.
Examples
Send a plain-text email:
operation = send-email
apiKey = <your token>
fromEmail = [email protected]
fromName = InTouch Alerts
to = [email protected]
subject = Nightly job finished
text = The 02:00 export completed successfully.
Send to several recipients with an HTML body and tags:
operation = send-email
apiKey = <your token>
fromEmail = [email protected]
to = [email protected],[email protected]
subject = Release notes
html = <h1>What's new</h1><p>Lots of fixes.</p>
tags = release,product
Send using a saved template with per-recipient variables:
operation = send-email
apiKey = <your token>
fromEmail = [email protected]
to = [{"email":"[email protected]","name":"Jane"}]
templateId = 3n9j5x8k7zy4qe1m
personalization = [{"email":"[email protected]","data":{"first_name":"Jane"}}]
Track delivery — list recent messages, then inspect one:
operation = list-messages
apiKey = <your token>
limit = 50
operation = get-message
apiKey = <your token>
messageId = 5ee0b166b251345e407c9207
List and inspect templates:
operation = list-templates
apiKey = <your token>
operation = get-template
apiKey = <your token>
templateId = 3n9j5x8k7zy4qe1m
Output
Every operation prints a single JSON object:
result— the MailerSend API response payload as a JSON string.status— the HTTP status code as a string (e.g.200,202).
On error the tool prints {"error": "<message>"} and exits non-zero, failing the step.
Publishes
The keys a later task may reference as {{taskName.key}}. Referencing anything not listed here resolves to nothing at run time.
errorresultstatus
Input Properties
Every property this tool accepts, from its own tool.iml.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
apiKey |
string | yes | — | MailerSend API token. Create one in the MailerSend dashboard under Settings > API tokens. Sent as 'Authorization: Bearer |
operation |
string | yes | — | One of: send-email, list-messages, get-message, list-templates, get-template |
fromEmail |
string | no | — | Sender email for send-email. Must be on a verified MailerSend domain. Optional only when templateId supplies a default sender. |
fromName |
string | no | — | Optional sender display name for send-email. |
to |
string | no | — | Recipient(s) for send-email. Comma-separated emails ([email protected],[email protected]) or a JSON array of {"email":"[email protected]","name":"A"} objects. Required for send-email (1-50 recipients). |
cc |
string | no | — | Optional CC recipient(s) for send-email. Same format as 'to' (max 10). |
bcc |
string | no | — | Optional BCC recipient(s) for send-email. Same format as 'to' (max 10). |
subject |
string | no | — | Email subject for send-email (max 998 chars). Optional only when templateId supplies a default subject. |
text |
string | no | — | Plain-text body for send-email. Provide at least one of text, html, or templateId. |
html |
string | no | — | HTML body for send-email. Provide at least one of text, html, or templateId. |
templateId |
string | no | — | MailerSend template id. Used as the body source for send-email and as the lookup id for get-template. |
personalization |
string | no | — | Optional JSON array of per-recipient template variables for send-email, e.g. [{"email":"[email protected]","data":{"name":"Jane"}}]. |
tags |
string | no | — | Optional comma-separated tags for send-email (max 5), used for filtering and analytics. |
messageId |
string | no | — | Message id. Required for get-message. |
domainId |
string | no | — | Optional domain id filter for list-messages and list-templates. |
page |
string | no | — | Optional page number for list-messages and list-templates. |
limit |
string | no | 25 |
Max records for list-messages and list-templates (10-100). Defaults to 25. |