Install
openclaw skills install mailtarget-emailSend transactional and marketing emails via Mailtarget API. Manage sending domains, templates, API keys, and sub-accounts. Use when the agent needs to send emails, manage email templates, configure sending domains, or handle any email infrastructure task through Mailtarget (mailtarget.co). Supports HTML emails, attachments, click/open tracking, template-based sending with substitution data, CC/BCC, reply-to, and custom headers.
openclaw skills install mailtarget-emailSend emails and manage email infrastructure via the Mailtarget API.
Set the MAILTARGET_API_KEY environment variable with your Mailtarget API key.
Get your API key from the Mailtarget dashboard → Settings → API Keys.
Use curl or any HTTP client. All requests go to https://transmission.mailtarget.co/v1 with Authorization: Bearer $MAILTARGET_API_KEY.
curl -X POST https://transmission.mailtarget.co/v1/layang/transmissions \
-H "Authorization: Bearer $MAILTARGET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": [{"email": "recipient@example.com", "name": "Recipient"}],
"from": {"email": "noreply@yourdomain.com", "name": "Your App"},
"subject": "Hello from Mailtarget",
"bodyHtml": "<h1>Hello!</h1><p>This is a test email.</p>",
"bodyText": "Hello! This is a test email."
}'
A successful response returns {"message": "Transmission received", "transmissionId": "..."}.
Use templateId with substitutionData instead of bodyHtml/bodyText:
{
"to": [{"email": "user@example.com", "name": "User"}],
"from": {"email": "noreply@yourdomain.com", "name": "Your App"},
"subject": "Welcome, {{name}}!",
"templateId": "welcome-template",
"substitutionData": {"name": "User", "company": "Acme"}
}
Control click and open tracking per transmission:
{
"optionsAttributes": {
"clickTracking": true,
"openTracking": true,
"transactional": true
}
}
Set transactional: true for transactional emails (password resets, receipts) to bypass unsubscribe preferences.
Include base64-encoded attachments:
{
"attachments": [{
"filename": "report.pdf",
"mimeType": "application/pdf",
"value": "<base64-encoded-content>"
}]
}
GET /template?page=1&size=10&search=keywordPOST /template with {"id": "slug", "name": "Display Name", "html": "<html>..."}GET /domain/sendingPOST /domain/sending with {"domain": "example.com"}PUT /domain/sending/{id}/verify-txtGET /domain/sending/{id}/spf-suggestionWhen paired with the cloudflare-dns skill, the agent can set up a sending domain end-to-end with zero manual DNS editing:
POST /domain/sending with {"domain": "example.com"}spfHostname, spfValue, dkimHostname, dkimValue, cnameHostname, cnameValuespfHostname and spfValuedkimHostname and dkimValuecnameHostname and cnameValue (set proxied: false)PUT /domain/sending/{id}/verify-txtGET /domain/sending/{id} — check spfVerified, dkimVerified, cnameVerifiedInstall the companion skill: clawhub install cloudflare-dns
New to Mailtarget + OpenClaw? See references/getting-started.md for a 5-minute setup guide.
See references/api.md for complete endpoint documentation including API key management, sub-accounts, and permissions.