✓ Verified 💻 Development ✓ Enhanced Data

Mailtarget Email

Send transactional and marketing emails via Mailtarget API.

Rating
5 (474 reviews)
Downloads
1,087 downloads
Version
1.0.0

Overview

Send transactional and marketing emails via Mailtarget API.

Complete Documentation

View Source →

Mailtarget Email

Send emails and manage email infrastructure via the Mailtarget API.

Setup

Set the MAILTARGET_API_KEY environment variable with your Mailtarget API key.

Get your API key from the Mailtarget dashboard → Settings → API Keys.

Sending Email

Use curl or any HTTP client. All requests go to https://transmission.mailtarget.co/v1 with Authorization: Bearer $MAILTARGET_API_KEY.

Simple send

bash
curl -X POST https://transmission.mailtarget.co/v1/layang/transmissions \
  -H "Authorization: Bearer $MAILTARGET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": [{"email": "[email protected]", "name": "Recipient"}],
    "from": {"email": "[email protected]", "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": "..."}.

Template-based send

Use templateId with substitutionData instead of bodyHtml/bodyText:

json
{
  "to": [{"email": "[email protected]", "name": "User"}],
  "from": {"email": "[email protected]", "name": "Your App"},
  "subject": "Welcome, {{name}}!",
  "templateId": "welcome-template",
  "substitutionData": {"name": "User", "company": "Acme"}
}

Tracking options

Control click and open tracking per transmission:

json
{
  "optionsAttributes": {
    "clickTracking": true,
    "openTracking": true,
    "transactional": true
  }
}

Set transactional: true for transactional emails (password resets, receipts) to bypass unsubscribe preferences.

Attachments

Include base64-encoded attachments:

json
{
  "attachments": [{
    "filename": "report.pdf",
    "mimeType": "application/pdf",
    "value": "<base64-encoded-content>"
  }]
}

Managing Templates

  • List: GET /template?page=1&size=10&search=keyword
  • Create: POST /template with {"id": "slug", "name": "Display Name", "html": "..."}

Managing Sending Domains

  • List: GET /domain/sending
  • Create: POST /domain/sending with {"domain": "example.com"}
  • Verify: PUT /domain/sending/{id}/verify-txt
  • Check SPF: GET /domain/sending/{id}/spf-suggestion

Autonomous Domain Setup (with cloudflare-dns skill)

When paired with the cloudflare-dns skill, the agent can set up a sending domain end-to-end with zero manual DNS editing:

  • Create sending domain: POST /domain/sending with {"domain": "example.com"}
  • Read required DNS records from the response: spfHostname, spfValue, dkimHostname, dkimValue, cnameHostname, cnameValue
  • Add SPF TXT record in Cloudflare using spfHostname and spfValue
  • Add DKIM TXT record in Cloudflare using dkimHostname and dkimValue
  • Add CNAME record in Cloudflare using cnameHostname and cnameValue (set proxied: false)
  • Verify domain: PUT /domain/sending/{id}/verify-txt
  • Confirm status via GET /domain/sending/{id} — check spfVerified, dkimVerified, cnameVerified
Install the companion skill: clawhub install cloudflare-dns

Getting Started

New to Mailtarget + OpenClaw? See references/getting-started.md for a 5-minute setup guide.

Full API Reference

See references/api.md for complete endpoint documentation including API key management, sub-accounts, and permissions.

Installation

Terminal bash

openclaw install mailtarget-email
    
Copied!

💻Code Examples

}'

-.txt
A successful response returns `{"message": "Transmission received", "transmissionId": "..."}`.

### Template-based send

Use `templateId` with `substitutionData` instead of bodyHtml/bodyText:

}

.txt
### Tracking options

Control click and open tracking per transmission:

}

.txt
Set `transactional: true` for transactional emails (password resets, receipts) to bypass unsubscribe preferences.

### Attachments

Include base64-encoded attachments:
example.sh
curl -X POST https://transmission.mailtarget.co/v1/layang/transmissions \
  -H "Authorization: Bearer $MAILTARGET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": [{"email": "[email protected]", "name": "Recipient"}],
    "from": {"email": "[email protected]", "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."
  }'
example.json
{
  "to": [{"email": "[email protected]", "name": "User"}],
  "from": {"email": "[email protected]", "name": "Your App"},
  "subject": "Welcome, {{name}}!",
  "templateId": "welcome-template",
  "substitutionData": {"name": "User", "company": "Acme"}
}
example.json
{
  "optionsAttributes": {
    "clickTracking": true,
    "openTracking": true,
    "transactional": true
  }
}
example.json
{
  "attachments": [{
    "filename": "report.pdf",
    "mimeType": "application/pdf",
    "value": "<base64-encoded-content>"
  }]
}

Tags

#web_and-frontend-development #api

Quick Info

Category Development
Model Claude 3.5
Complexity One-Click
Author masasdani
Last Updated 3/10/2026
🚀
Optimized for
Claude 3.5
🧠

Ready to Install?

Get started with this skill in seconds

openclaw install mailtarget-email