Amphibian

Escort

For ExpressionEngine 6, ExpressionEngine 3+, ExpressionEngine 2 • Current Version: 1.4.1

Purchase for $12

Let your site’s email get sent by the pros! Escort seam­less­ly routes all emails gen­er­at­ed by your site through a bevy of third-par­ty trans­ac­tion­al email ser­vices, all using their HTTP APIs. This pre­vents issues endem­ic to send­ing email via PHP’s mail() func­tion on your serv­er — name­ly delayed send­ing and your emails being flagged as spam.

Escort cur­rent­ly sup­ports Mail­Gun, Man­drill, PostageApp, Post­mark, Send­Grid, and Spark­Post. Want extra assur­ance? Escort sup­ports failover from one ser­vice to the next — acti­vate mul­ti­ple ser­vices to ensure that if one ser­vice fails for any rea­son, the next in line will be used to send your email. If all ser­vices fail, ExpressionEngine®‘s default mail set­up will step-in as a last resort. 

Escort is also com­pat­i­ble with any third-par­ty add-on which uses ExpressionEngine®‘s Email class to send email — this includes pop­u­lar add-ons such as Freeform, Cart­Throb, Expres­so Store, Bril­liant Retail, and Bet­ter Work­flow. And yes, it sup­ports attach­ments as well. 

Although all of these ser­vices offer an SMTP option which you can use in Expres­sio­nEngine® with­out an add-on, many web servers don’t sup­port send­ing SMTP email, and most of these ser­vices rec­om­mend using their HTTP APIs over using their SMTP servers. 

Requirements

  • Expres­sio­nEngine® 3.0.0 or new­er; Expres­sio­nEngine® 2.5.0 or newer
  • cURL sup­port
  • IMAP exten­sion for PHP
  • Account with a sup­port­ed trans­ac­tion­al email service

Documentation

Instal­la­tion

Upload the includ­ed escort fold­er to your /​system/​user/​addons/​ direc­to­ry (or /​system/​expressionengine/​third_​party/​ direc­to­ry if you’re run­ning EE2), then install Escort from the Add-On Man­ag­er screen (or the Add-Ons → Exten­sions screen if you’r run­ning EE2). 

Con­fig­u­ra­tion

The eas­i­est way to con­fig­ure Escort is via its Set­tings screen, where you will need to both enable and enter API keys/​credentials for all the ser­vices you wish to use. If you do enable mul­ti­ple ser­vices, drag the ser­vices into the order with which you’d like Escort to use when attempt­ing to send your email. 

If any indi­vid­ual ser­vice fails, Escort will move on to the next ser­vice. (Your email will only ever be sent once.) 

You may also con­fig­ure Escort in part or in whole via Expres­sio­nEngine’s config.php file using the escort_​settings con­fig array. Because Escort is MSM-friend­ly, you must use keys with­in the set­tings array match­ing your site IDs. This exam­ple 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' => '',
    )
);

Exten­sion Hooks

escort_​pre_​send

This hook allows devel­op­ers to mod­i­fy the the struc­tured email data before it’s sent off to each ser­vice. 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;
}

Support

Vis­it the offi­cial sup­port forums on devot:ee.

Changelog

  • 1.4.1 (September 28th, 2022)
    • Switched to SSL end­point for Postmark

Browse more software