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 [email protected]:password123 \
-d "method=send" \
-d "[email protected]" \
-d "[email protected]" \
-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"]}'
$api = new \Maxemail\Api\Client([
'username' => '[email protected]',
'password' => 'password123'
]);
$trxKey = $api->transactional->send(
'[email protected]',
'[email protected]',
'Oxford Stones',
'Latest Newsletter from Oxford Stones',
'<html><body>Email HTML content</body></html>',
'Email text content',
[
'tags' => ['order', 'confirmation', 'guest']
]
);