Transactional API

Transactional Emails can be sent using the Maxemail API, by simply sending the component parts of the email (eg. to, from, subject, content). This has an advantage for developers over Transactional SMTP, as it doesn't require building a fully formatted email message, leaving Maxemail to build it instead.

A single API method is needed: transactional.send

The API method returns a unique identifier for the Transactional Email send, which can be used to match up to Transactional Email reports.

The examples below show how this might be used in different programming languages.

curl --request POST \
--url https://mxm.xtremepush.com/api/json/transactional \
--basic --user username@example.com:password123 \
-d "method=send" \
-d "toAddress=recipient@example.com" \
-d "fromAddress=newsletter@oxfordstones.com" \
-d "fromAlias=Oxford Stones" \
-d "subject=Latest Newsletter from Oxford Stones" \
-d "htmlContent=<html><body>Email HTML content</body></html>" \
-d "textContent=Email text content" \
-d 'options={"tags":["order", "confirmation", "guest"]}'

Use the PHP API Client to connect to the API.

$api = new \Emailcenter\MaxemailApi\Client([
    'username' => 'username@example.com',
    'password' => 'password123'
]);
$trxKey = $api->transactional->send(
    'recipient@example.com',
    'newsletter@oxfordstones.com',
    'Oxford Stones',
    'Latest Newsletter from Oxford Stones',
    '<html><body>Email HTML content</body></html>',
    'Email text content',
    [
        'tags' => ['order', 'confirmation', 'guest']
    ]
);