Email and Mandrill - showing multiple recipients

Hi - can anyone help me with sending an email to multiple recipients and needing to show all in the ‘To’ field. Currently it will only show one recipient per email. I need to send an email to be able to show all the recipients so that they know who has received the email. I know I have to add the line X-MC-PreserveRecipients: true. This will ensure the behavior is applied only to the emails generated using this specific template. However, I do not know where/how I am supposed to use this.

Thanks
Amy

Based on the mandrill documentation, that looks like it needs to go into the SMTP header.

You should be able to modify this with a script. Refer to this for an example: SendGrid and custom_args - #2 by Marten

I’m not sure that it’ll carry through to Mandrill, however. It’ll need testing.

Hi - thank you for the information. I checked with Mandrill last week on this also. Here is what they said - I haven’t gotten it working yet but incase this helps anyone else.

  1. Add the Header in OL Connect: In the configuration settings for your email template within OL Connect, ensure that you include the header X-MC-PreserveRecipients in the Headers section of your email.

  2. Set the Value:
    • To hide recipients: Add the line X-MC-PreserveRecipients: false.
    • To preserve recipients: Add the line X-MC-PreserveRecipients: true.
    This ensures the behavior is applied only to the emails generated using this specific template.

  3. Verify Header Placement: In the screen you provided, it seems headers like meta[name=email-cc] are being used. If you’re dynamically generating headers via scripting in the template, ensure the X-MC-PreserveRecipients line is included in the script block where the headers are defined.

  4. Test the Setup: Once the header is added, send a few test emails to ensure the recipients are either visible or hidden as intended.

Can I ask what your script with the addHeader call looks like?

The code in the earlier link is a bit confusing since it uses JSON.stringify. There is no need for that, passing true should be sufficient: addHeader("X-MC-PreserveRecipients", true)

I have been trying to figure this out. I haven’t worked with emails that often. I do not where I am supposed to put the script. I know in the header but I guess I do not know where exactly.

We’re talking about a control script with an addHeader call.

This is described in the documentation here:

https://help.uplandsoftware.com/objectiflune/en/olconnect-cef/2024.1/designer/Output/Email/ESPs.html#Adding

You should end up with something similar to this:

image

1 Like

This is a script that I use to add some stuff to the head of the email.

Just a regular script.

The only way to include an SMTP header is through addHeader.

Adding a <meta> entry to <head> is useful in some scenarios but it won’t affect SMTP headers for email output. (I double-checked our code to make sure.)