Tips, Tricks & Best Practices

thomasvbe
Contributor

Use CRM object that triggers workflow to personalise email

Is there any way that you can use the object that triggered your workflow, in programmable modules, to personalize your email?

 

Use case: I have a deal object that triggers a workflow that sends out a marketing email.
In that email, I want to personalize a custom field that contains comma-separated values and convert it to an unordered list. If there are more than 2 items in the list, I want to make some changes in the content to make it plural.

 

Thx

Thomas!

0 Upvotes
3 Replies 3
JOHara
Participant

Use CRM object that triggers workflow to personalise email

Hey @thomasvbe for multi valued properties email is opinionated about the formatting of the properties and returns a string. You could create a custom module and make use of the Programmable Email Beta to re-retrieve the deal in an unfromatted state. 

 

To do this, you can use the crm_object function 

 

 

{% set unformatted_deal = crm_object("deal", deal.hs_object_id, "property1,property2", false) %}

 

 

The final parameter of "false" turns off formatting. You can then get unformatted_deal.property1 and iterate over the values of it as you wish.

 

When testing this, you can hard-code a deal ID instead of deal.hs_object_id so you can test this as a stand alone module instead of testing via Workflow enrollment

 

 

0 Upvotes
Bryantworks
Key Advisor | Diamond Partner
Key Advisor | Diamond Partner

Use CRM object that triggers workflow to personalise email

Hey @thomasvbe, at the moment I don't think you can do this as it'll appear as a semi-colon delimited string in the personalization which you've likely seen.  

I think you could solve this by mapping it to another field if you have Ops Hub and the "Custome Code" step in the workflow, though.  

Chris Bryant | Your Dedicated HubSpot Expert
thomasvbe
Contributor

Use CRM object that triggers workflow to personalise email

Yes, we have Ops Hub and can use custom code.
What would you suggest? Map it to a list property?
I already tried to put HTML markup with "<ul><li>List item</li></ul>" in a custom property (before I custom code it to convert "listitem1, listitem2" to HTML) and display it in an email, but it returned as that string and not the formatted HTML list.

0 Upvotes