Home Forums Event Espresso Premium The cc option not working with mandril in EE4 email template

The cc option not working with mandril in EE4 email template

Posted: February 12, 2019 at 7:22 am


February 12, 2019 at 7:22 am

We have configured mandril with event espresso. To get a copy of the recipient email to primary registrant we have updated the email templates as below link. However the cc in not including in mandril email delivery. Please advice.


  • Support Staff

February 12, 2019 at 9:33 am


You can install & activate this code as a plugin on your site:

and what that will do is hook into the Mandrill plugin to allow the sending a cc to the email address in the CC field.


February 12, 2019 at 11:58 am

Hi Josh,

The suggested method is not working. Could you recheck the suggested link as it does not contain cc related formatting?


  • Support Staff

February 12, 2019 at 12:37 pm

May I ask what do you mean by “does not contain cc related formatting”? Are you using this Mandrill plugin?


February 13, 2019 at 2:37 am

Yes. We are using this plugin.

The primary registrant still not receiving a copy of the other recipient’s emails.

We have used below code in a plugin as you suggested. Please have a look into this.

function rse_fix_wpmandrill_to( $payload ) {
$new_to = array();
if ( isset( $payload[‘to’] ) ) {
foreach ( $payload[‘to’] as $to ) {
$new_to[] = rse_maybe_parse_formatted_email( $to );
} else {
return $payload;

$payload[‘to’] = $new_to;
return $payload;
add_filter( ‘mandrill_payload’, ‘rse_fix_wpmandrill_to’ );

function rse_maybe_parse_formatted_email( $to ) {
$to_address = isset( $to[’email’] ) ? $to[’email’] : null;

if ( empty( $to_address ) ) return $to; //get out because wpMandrill has likely started doing something strange.

if( preg_match( ‘/(.*)<(.+)>/’, $to_address, $matches ) ) {
if ( count( $matches ) == 3 ) {
$to[‘name’] = $matches[1];
$to[’email’] = $matches[2];

return $to;


  • Support Staff

February 13, 2019 at 8:55 am


In addition to the above, can you add the following:

Also, please be sure to activate the custom plugin after the code is added.


February 14, 2019 at 2:28 am


Thanks, Josh. Now cc is working. However primary registrant is now receiving an additional mail of his for single registrant is getting 2 emails.

Is there a way to filter this condition. So that single registrant (or primary registrant) should receive only one mail of his/her registration.


  • Support Staff

February 14, 2019 at 10:23 am

If you remove the Primary Registrant Email shortcode from the CC field, the Primary Registrant will receive only one mail of their registration for that message type.

Then, if you want to send the Primary Registrant an additional email that includes a summary of all registrations in the transaction, you can activate the Primary Registrant Recipient context of that message type.


February 15, 2019 at 3:12 am

Hi Josh,
In our requirement, the primary registrant needs to receive an email copy of other registrant and only one his registration email, not the summary email.
Example scenario: (Primary, Registrant A and Registrant B )

1.Primary (Primary member’s registration email)

2.Registrant A (One email to Registrant A and copy to primary)

3.Registrant B (One email to Registrant B and copy to primary)

Please have a look into this.


  • Support Staff

February 15, 2019 at 7:07 am


I’ve looked into this and I don’t believe there’s a way to not send a cc a copy to the Primary Attendee if you’ve set the Primary Attendee email’s address into the cc field. One thing to keep in mind is the Primary Attendee is a registrant too.

In other words, in the scenario you’ve outlined, it’s more like:

1.Primary, is also Registrant A
2.Registrant B
3.Registrant C

The support post ‘The cc option not working with mandril in EE4 email template’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Josh 7 months ago ago

Topic Tags

Tagged: ,


This topic is: not resolved
Do NOT follow this link or you will be banned from the site!