How we added a personalized email signature into a Marketo Sales Insights email from Dynamics CRM

RussellPalmer
Level 1

How we added a personalized email signature into a Marketo Sales Insights email from Dynamics CRM

Our problem:

The business team wanted to send emails from within Dynamics CRM through Marketo with a personalized signature from the individual sending the email appended. The problem we faced was that the person clicking the send button in Dynamics CRM may not always be the owner of the contact record, so we could not build the signature in Marketo using synced lead data.

 

Our Solution:

After looking at some inefficient complex solutions using Marketo’s API to write a custom email process and the built-in MSI (Marketo Sales Insights) functionality in Microsoft Dynamics CRM, we opted for MSI with our own “hack” to add the signatures. After some investigating, we found that in the JavaScript file sendMarketoEmail.js, there is a function loadEmailTemplateSuccess which passes the HTML template retrieved from Marketo into the Marketo HTML editor in Dynamics. Here is where we decided to place our web service call and pass the current Dynamics user and the HTML template. Then, within our custom code, we query the system user table in Dynamics for specific details to build the signature and then merge it into the HTML from the original template. Our web service then passes back this new HTML and sends that to the HTML editor to display in Dynamics.

Script from sendMarketoEmail.js

function loadEmailTemplateSuccess(data, textStatus, XmlHttpRequest) {

    if (data && data.length > 0) {

        $('#subject').val(" " + data[0].mkt_subjectbin);

       We commented this line out and call in it our own function

        //CKEDITOR.instances.emailBody.setData(data[0].mkt_templatebin + "  ");

        Our function we pass the template to

        GetSignature(data[0].mkt_templatebin + " ");

}

}

What our custom signature looks like...

RussellPalmer_0-1614449003931.png

Please reach out if you have any question related to our implementation.

Thanks,

Russ Palmer