Let your site’s email get sent by the pros! Escort seamlessly routes all emails generated by your site through a bevy of third-party transactional email services, all using their HTTP APIs. This prevents issues endemic to sending email via PHP’s mail()
function on your server — namely delayed sending and your emails being flagged as spam.
Escort currently supports MailGun, Mandrill, PostageApp, Postmark, SendGrid, and SparkPost. Want extra assurance? Escort supports failover from one service to the next — activate multiple services to ensure that if one service fails for any reason, the next in line will be used to send your email. If all services fail, ExpressionEngine®‘s default mail setup will step-in as a last resort.
Escort is also compatible with any third-party add-on which uses ExpressionEngine®‘s Email class to send email — this includes popular add-ons such as Freeform, CartThrob, Expresso Store, Brilliant Retail, and Better Workflow. And yes, it supports attachments as well.
Although all of these services offer an SMTP option which you can use in ExpressionEngine® without an add-on, many web servers don’t support sending SMTP email, and most of these services recommend using their HTTP APIs over using their SMTP servers.
Upload the included escort folder to your /system/user/addons/ directory (or /system/expressionengine/third_party/ directory if you’re running EE2), then install Escort from the Add-On Manager screen (or the Add-Ons → Extensions screen if you’r running EE2).
The easiest way to configure Escort is via its Settings screen, where you will need to both enable and enter API keys/credentials for all the services you wish to use. If you do enable multiple services, drag the services into the order with which you’d like Escort to use when attempting to send your email.
If any individual service fails, Escort will move on to the next service. (Your email will only ever be sent once.)
You may also configure Escort in part or in whole via ExpressionEngine’s config.php file using the escort_settings config array. Because Escort is MSM-friendly, you must use keys within the settings array matching your site IDs. This example will get you started:
$config['escort_settings'] = array( 1 => array( 'service_order' => array( 'mandrill', 'postmark' ), 'mandrill_active' => 'y', 'mandrill_api_key' => 'XXXXXX', 'mandrill_subaccount' => '', 'mailgun_active' => 'n', 'mailgun_api_key' => '', 'mailgun_domain' => '', 'postageapp_active' => 'n', 'postageapp_api_key' => '', 'postmark_active' => 'y', 'postmark_api_key' => 'XXXXXX', 'sendgrid_active' => 'n', 'sendgrid_api_key' => '', 'sparkpost_active' => 'n', 'sparkpost_api_key' => '', ) );
This hook allows developers to modify the the structured email data before it’s sent off to each service. Use like so in your extension:
function escort_pre_send($service, $data) { // do something to the $data array based on the value of $service return $data; }
Visit the official support forums on devot:ee.