emailmandrillzapierhubspotbcc

Hubspot will not recognise & log to CRM my BCC emails from AMndrill


I'm using Zapier plus Mandrill to send transactional emails to customers, and want these emails to be logged to the relevant customer account in my Hubspot CRM.

Hubspot supports a BCC address that can do this, and works for my sending domain when I send BCC email directly out of Gmail - so the actual Hubspot BCC functionality works.

However, when I send email from that same domain via Mandrill, the Hubspot BCC does not work.

Comparing the address headers generated by Gmail and by Zapier/Mandrill, I can see that Zapier is creating the BCC address using 'bcc' type for the 'to' array, resulting in a secondary 'to' address for the BCC. Gmail generates an explicit 'bcc' field:

Example BCC-ed address block from Gmail

From: Richard Foxworthy <richard.foxworthy@4thparty.com.au>
Date: Sun, 1 Mar 2020 09:24:24 +1100
Message-ID: <CAGDDT9oRrteY8yek0GppMvfBiMiRNZEAZfJ4JvcpavTY_i69XA@mail.gmail.com>
Subject: testing BCC headers for hubspot
To: First_name Second_name <recipientaddress@domain.com>
Content-Type: multipart/alternative; boundary="0000000000004b1468059fbe6b8a"
Bcc: UniqueHubspotID@bcc.hubspot.com

Example BCC-ed Zapier/Mandrill address block (JSON, retrieved via Mandrill API)

{"from_name":"Vram Name","from_email":"email@domain.com","subject":"Subject line goes here","headers":{"Reply-To":"sendingaddress@domain.com","To":"recipientaddress@domain.com"},"to":{"email":"UniqueHubspotID@bcc.hubspot.com","name":""}

And here's an extract from an API log from Mandril relating to one of these emails

{
    "key": "Mandrill_key_goes_here",
    "template_name": "Mandrill_email_template_name",
    "template_content": [
        {
            "content": "<h1>html content</h1>",
            "name": "$main_title"
        }
    ],
    "message": {
        "from_email": "sendingaddress@sendingdomain.com",
        "from_name": "Sender Name",
        "subject": "Subject line",
        "headers": {
            "Reply-To": "sendingaddress@sendingdomain.com"
        },
        "to": [
            {
                "email": "primaryrecipient@recievingdomain.com"
            },
            {
                "email": "UniqueID@bcc.hubspot.com",
                "type": "bcc"
            }

I'm assuming the problem with Hubspot logging these mails is the absence of a BCC field in the email address headers.

Looking for guidance from anyone who understands these systems in better detail:

Thanks


Solution

  • I found a solution - posting it hee in case it helps others in future...

    On Mandrill side its possible to set an option "Expose The List Of Recipients When Sending To Multiple Addresses" which preserves the list of recipients when there are multiple CCs or BCCs or whatever.

    It turns out that by turning this on, Mandrill passes the right message header so Hubspot can recognise and log the BCCs.