post
https://t.themarketer.com/api/v1/transactional/send-email
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
If you want to send your transactional emails through theMarketer (for example order confirmations, invoice emails etc.), you can do so by using our Transactional Emails API. Keep in mind that this service is billed separately from your theMarketer subscription.
By default, the Transactional Emails functionality is in Sanbox mode, which means that emails can only be sent out to email addresses which are defined in the sandbox recipients list.
When you plan to go live, please ensure that you have added transactional emails credit to your account, and that you have used the Go Live button in the interface.
As an alternative to the API, you can also use SMTP. Sample call example with PHPMailer:
<?php
require "vendor/autoload.php";
use PHPMailer\PHPMailer\PHPMailer;
$smtpEndpoint = "smtp1.themarketer.com";
$apiKey = "MyAPI_REST_Key";
$customerId = “Customer_Id_from_theMarketer”;
$smtpPort = "2525"; //or 42525, depending on your server configuration
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = $smtpEndpoint;
$mail->Port = $smtpPort;
$mail->SMTPAuth = true;
$mail->Username = $apiKey;
$mail->Password = $customerId;
$mail->addAddress("[email protected]", "Receiver Name");
$mail->Subject = "Your email subject line";
$mail->msgHTML(file_get_contents("message.html"), __DIR__);
$mail->Body = "This is just a plain text message body";
$mail->addAttachment("attachment.extension");
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "The email message was sent.";
}
?>