API ReferenceMarketing EmailSend Marketing Email

    Send Marketing Email

    The Marketing Email API (MAPI) is designed for promotional content, newsletters, and large-scale campaigns. It includes built-in compliance checks and asynchronous queue-based processing.

    POSThttps://mapi.simplysend.email/send

    Parameters

    toRequired
    string
    Email address of the recipient.
    fromRequired
    string
    The sender email address (must be a verified domain). e.g. `"Acme Newsletters" <[email protected]>` or `[email protected]`
    subjectRequired
    string
    The subject line for the email.
    htmlRequired
    string
    HTML body content. Include required template variables. See below compliance template below.
    subscriptionGroupIdRequired
    string

    The ID of the subscription group to route the email through.

    Recipients must be actively subscribed to this group to receive the email. The system automatically filters out unsubscribed, bounced, or complaining addresses to safeguard compliance and deliverability.

    Exception: This is optional if you have the "Optional Subscription Group ID" approval (see Accounts Page > Approvals tab) - in which case the system will fall back to your default subscription group created automatically. The email subscription check is skipped in this case.

    text
    string
    The plain text version of the email for clients that don't support HTML.
    replyTo
    string
    Email address for replies. e.g. `[email protected]` or `"Acme Support" <[email protected]>`
    headers
    object

    Custom headers to include in the email. e.g. { "X-Entity-ID": "user_12345", "X-Feedback-ID": "marketing_abc" }

    Note: List-Unsubscribe is automatically injected by the system.

    templateVariables
    object

    Key-value pairs for dynamic content injection. e.g. { "first_name": "John", "discount_code": "WELCOME20" }

    These can be referenced in your HTML or text body using double curly braces, e.g. {{first_name}}.

    enableClickTracking
    boolean

    Wrap all links in the email with click-tracking redirect URLs so each click is recorded as a Click event. Defaults to false.

    Only applies when your account is routed via the OCI provider. Has no effect on AWS SES sends.

    campaignId
    string

    Associate the emails with a campaign. Create the campaign first using the SimplySend UI. Email analytics events (send, delivery, open, click, bounce, etc.) are recorded against the campaign Id.

    RequestPOST
    curl -X POST https://mapi.simplysend.email/send \
      -H "X-Api-Key: your_marketing_api_key" \
      -H "X-Id: your_account_id" \
      -H "Content-Type: application/json" \
      -d '{
        "to": "[email protected]",
        "from": "marketing@yourdomain.com",
        "subject": "Special Offer - 20% Off",
        "html": "<html><body><h1>20% Off!</h1><p>Visit our store.</p><br><br><p>{{company_address_html}}</p><p>{{unsubscribe_email_html}}</p><p>{{report_abuse_email_html}}</p></body></html>",
        "subscriptionGroupId": "list_abc123",
        "campaignId": "campaign_id123"
      }'
    {
      "success": true,
      "data": {
        "message": "Marketing email queued for processing",
        "jobId": "job_1234567890_abc",
        "status": "queued",
        "from": "marketing@yourdomain.com",
        "totalRecipients": 1,
        "recipients": [
          {
            "email": "[email protected]",
            "status": "queued",
            "role": "to"
          }
        ]
      }
    }
    Permission-Based Marketing

    All recipients MUST have valid consent records. If a recipient lacks valid consent or has unsubscribed, the API will reject the send request.

    Auto-Injected Headers

    List-Unsubscribe & List-Unsubscribe-Post

    The system automatically injects required RFC 8058 compliant headers (with one-click unsubscribe support) unless explicitly overridden in the request payload.

    Compliance Templates