For ExpressionEngine 6, ExpressionEngine 3+, ExpressionEngine 2 • Current Version: 1.4.1
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.
Requirements
- ExpressionEngine® 3.0.0 or newer; ExpressionEngine® 2.5.0 or newer
- cURL support
- IMAP extension for PHP
- Account with a supported transactional email service
Documentation
Installation
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).
Configuration
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' => '',
)
);
Extension Hooks
escort_pre_send
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;
}
Changelog
- 1.4.1 (September 28th, 2022)
- Switched to SSL endpoint for Postmark
- 1.4.0 (March 25th, 2021)
- 1.3.4 (October 26th, 2020)
- Fixed US/EU region selections for Mailgun
- 1.3.3 (March 4th, 2019)
- Added EU region option for Mailgun
- Removed services plan descriptions in favour of simple links to each service’s website
- 1.3.2 (November 3rd, 2017)
- Interface tweaks for EE4 compatibility
- 1.3.1 (October 17th, 2016)
- Fix for some HTML messages being garbled due to quoted_printable encoding
- Fix for missing icons on settings screen in EE 3.3.0+
- 1.3.0 (February 29th, 2016)
- [IMPORTANT] Updated SendGrid service to use their API key rather than username/password — you will need to generate an API key and update your Escort settings after upgrading in order to continue using SendGrid
- [EE3] Fixed bug when writing attachments to the filesystem for certain services
- Added SparkPost as a new service option
- Updated all service descriptions to accurately reflect current sending limits under free plans
- Escort now logs notices to the developer log when a service fails or is active but missing required credentials
- Fixed potential memory issue when sending large HTML emails
- Fixed deprecation notice when sending attachments with some services under PHP 5.5+
- 1.2.1 (November 1st, 2015)
- External service links on the settings screen are now masked
- Renamed ‘views’ folder to ‘View’ to follow EE3 standards
- 1.2.0 (October 28th, 2015)
- Now compatible with EE3
- [EE3] New interface and revised language
- [EE3] Removed some redundant code for PHP 5.3
- EE2 version is now feature-frozen
- 1.1.4 (June 4th, 2015)
- Fixed a bug with CC and BCC addresses when ExpressionEngine’s email protocol was set to SMTP
- Added the ability to set Mandrill templates and template content via the extension hook
- Fixed PHP notice when an email with no subject was sent
- 1.1.2 (January 14th, 2015)
- Fixed bug in settings screen when no previous settings have been saved
- 1.1.1 (January 6th, 2015)
- Fixed PHP error introduced in version 1.1 when running PHP 5.5
- 1.1 (December 31st, 2014)
- Added the ability to configure Escort via ExpressionEngine’s config.php file
- 1.0.9 (January 17th, 2014)
- Added multiple BCC support for Mandrill enabled by changes to API (h/t Bryant Hughes)
- 1.0.8 (December 9th, 2013)
- Added ability to specify a Mandrill subaccount
- Added
escort_pre_send
extension hook
- 1.0.7 (August 23rd, 2013)
- Addressed issue where reply-to addresses could be added twice in some cases
- Addressed issue which occurred when an empty value was set via config.php for
email_crlf
- 1.0.6 (April 10th, 2013)
- More character-encoding fixes, please kill me now
- 1.0.5 (March 31st, 2013)
- More tweaks in cleaning “quotable-printable”-encoded messages
- 1.0.4 (March 14th, 2013)
- Fix for Q‑encoded subject lines
- Better cleaning of “quotable-printable”-encoded messages
- 1.0.3 (March 6th, 2013)
- Fix for Cc and Bcc when using PostageApp
- Added custom X‑Mailer header
- Now including changelog 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 appearing in member activation and other emails (h/t Justin Kimbrell)
- 1.0 (February 27th, 2013)