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.