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;
}

Changelog

  • 1.4.1 (September 28th, 2022)
    • Switched to SSL end­point for Postmark
  • 1.4.0 (March 25th, 2021)
    • Added EE6 version
  • 1.3.4 (October 26th, 2020)
    • Fixed US/EU region selec­tions for Mailgun
  • 1.3.3 (March 4th, 2019)
    • Added EU region option for Mailgun
    • Removed ser­vices plan descrip­tions in favour of sim­ple links to each ser­vice’s website
  • 1.3.2 (November 3rd, 2017)
    • Inter­face tweaks for EE4 compatibility
  • 1.3.1 (October 17th, 2016)
    • Fix for some HTML mes­sages being gar­bled due to quoted_​printable encoding
    • Fix for miss­ing icons on set­tings screen in EE 3.3.0+
  • 1.3.0 (February 29th, 2016)
    • [IMPOR­TANT] Updat­ed Send­Grid ser­vice to use their API key rather than username/​password — you will need to gen­er­ate an API key and update your Escort set­tings after upgrad­ing in order to con­tin­ue using SendGrid
    • [EE3] Fixed bug when writ­ing attach­ments to the filesys­tem for cer­tain services
    • Added Spark­Post as a new ser­vice option
    • Updat­ed all ser­vice descrip­tions to accu­rate­ly reflect cur­rent send­ing lim­its under free plans
    • Escort now logs notices to the devel­op­er log when a ser­vice fails or is active but miss­ing required credentials
    • Fixed poten­tial mem­o­ry issue when send­ing large HTML emails
    • Fixed dep­re­ca­tion notice when send­ing attach­ments with some ser­vices under PHP 5.5+
  • 1.2.1 (November 1st, 2015)
    • Exter­nal ser­vice links on the set­tings screen are now masked
    • Renamed views’ fold­er to View’ to fol­low EE3 standards
  • 1.2.0 (October 28th, 2015)
    • Now com­pat­i­ble with EE3
    • [EE3] New inter­face and revised language
    • [EE3] Removed some redun­dant code for PHP 5.3
    • EE2 ver­sion is now feature-frozen
  • 1.1.4 (June 4th, 2015)
    • Fixed a bug with CC and BCC address­es when Expres­sio­nEngine’s email pro­to­col was set to SMTP
    • Added the abil­i­ty to set Man­drill tem­plates and tem­plate con­tent via the exten­sion hook
    • Fixed PHP notice when an email with no sub­ject was sent
  • 1.1.2 (January 14th, 2015)
    • Fixed bug in set­tings screen when no pre­vi­ous set­tings have been saved
  • 1.1.1 (January 6th, 2015)
    • Fixed PHP error intro­duced in ver­sion 1.1 when run­ning PHP 5.5
  • 1.1 (December 31st, 2014)
    • Added the abil­i­ty to con­fig­ure Escort via Expres­sio­nEngine’s config.php file
  • 1.0.9 (January 17th, 2014)
    • Added mul­ti­ple BCC sup­port for Man­drill enabled by changes to API (h/​t Bryant Hughes)
  • 1.0.8 (December 9th, 2013)
    • Added abil­i­ty to spec­i­fy a Man­drill subaccount
    • Added escort_pre_send exten­sion hook
  • 1.0.7 (August 23rd, 2013)
    • Addressed issue where reply-to address­es could be added twice in some cases
    • Addressed issue which occurred when an emp­ty val­ue was set via config.php for email_crlf
  • 1.0.6 (April 10th, 2013)
    • More char­ac­ter-encod­ing fix­es, please kill me now
  • 1.0.5 (March 31st, 2013)
    • More tweaks in clean­ing quotable-printable”-encoded messages
  • 1.0.4 (March 14th, 2013)
    • Fix for Q‑encoded sub­ject lines
    • Bet­ter clean­ing of quotable-printable”-encoded messages
  • 1.0.3 (March 6th, 2013)
    • Fix for Cc and Bcc when using PostageApp
    • Added cus­tom X‑Mailer header
    • Now includ­ing changel­og in download
  • 1.0.2 (March 5th, 2013)
    • Fix for Cc and Bcc when using Mandrill
  • 1.0.1 (February 28th, 2013)
    • Fix for {unwrap} tags appear­ing in mem­ber acti­va­tion and oth­er emails (h/​t Justin Kimbrell)
  • 1.0 (February 27th, 2013)
    • Ini­tial release

Browse more software