Re: Displaying Custom Data in an Email

kenmckown
Level 4

I was curious if anyone has a good solution for this issue.

 

We are about to send out price change emails for various products. We want to display that new price in an email based on their ID, NOT their email address, as some emails may have multiple products.

 

I am trying to solution storing that data and using a custom token to display that price in the email sent to that person via their ID (either Salesforce ID or another ID already stored in Marketo)

 

What are the best solutions for this?

Tags (2)
17 REPLIES 17
SanfordWhiteman
Level 10 - Community Moderator

You’re looking at a Marketo Custom Object or a JSON field (Textarea field w/JSON).

 

In both cases you do the output using a Velocity (Email Script) token.

 

Which one to choose depends on how many products you’re talking about. Would be good to know more about the shape and scope of the data.

 

 

kenmckown
Level 4

We have around 20 products, but won't be using them all for this particular example, but maybe in the future. We would want to match this on their customer ID to display the price change in an email. I have created a test Custom Object in our instance, and create a field for New Price and one for Customer ID, which I made the dedupe rule.

SanfordWhiteman
Level 10 - Community Moderator
You don't want Price+Customer ID to be the dedupe fields. You want Product+Customer ID. Price is just a standard field. This is the way to have multiple Product-Customer-Price records.
kenmckown
Level 4

That makes sense, I did not make the Price field the de-dupe field, just the Customer ID, but adding Product as well makes sense. How do these tie to emails? Do I have to upload values to these fields and then use tokens to pull them in? I am familiar with how Eloqua did it, I worked in that system for over 15 years, but Marketo's option is new to me.

SanfordWhiteman
Level 10 - Community Moderator
Import using either the UI or API. Then output using Velocity (Email Script) {{my.tokens}}.
kenmckown
Level 4

Digging into these deeper, once a field is approved, it seems I cannot edit it anymore. Is that by design?

SanfordWhiteman
Level 10 - Community Moderator
Yes, that's expected. The good thing about COs, unlike Person fields, is you can delete them completely. So you can tweak your setup infinitely during development.
kenmckown
Level 4

I added data to the fields, tried to call it with an Email Script token in the email, and it is outputting this:

${scottSystemsPriceIncrease_cList.get(0).newPrice}

 

SanfordWhiteman
Level 10 - Community Moderator

Please use the syntax highlighter when inserting code so it’s readable. I edited your post this time.

SanfordWhiteman_0-1740586621363.png

 

The output you’re showing is what happens if there’s no data for that person. (Velocity’s fallback when a reference is null, or certain types of errors, is to just print the original code.)

 

Always start by dumping the entire list:

${scottSystemsPriceIncrease_cList}

 

Can you show the Custom Objects tab for a person with at least one CO, and then show the Preview pane when your {{my.token}} has the above code?

 

And of course:

  • make sure you have the field checked off in the tree in Script Editor
  • when testing Velocity, make sure you’re using Preview-by-List or sending a real email, not Send Sample or default Preview

 

 

kenmckown
Level 4

This is weird. I see the activity of the value being added in the Activity Log

kenmckown_0-1740587824390.png

I am using the Customer ID as the link, it shows they have data, but I am not seeing a Custom Objects data tab in the people viewer.

SanfordWhiteman
Level 10 - Community Moderator

Did you set the CO to be visible in the lead UI? That’s a setting in Admin » Marketo Custom Objects » <your object>.

kenmckown
Level 4

Sorry, yes I had it hidden. Checking now.

kenmckown
Level 4

I clicked show, but still don't see it.

kenmckown_0-1740591580007.png

 

SanfordWhiteman
Level 10 - Community Moderator

@kenmckown please check your thread and supply updates.

SanfordWhiteman
Level 10 - Community Moderator

@kenmckown please return to your thread and check responses.

kenmckown
Level 4

Apologies, we moved to a different solution as this was time sensitive. I am circling back around, the Customer ID field I am using is on the account in SFDC. I am still not able to see Custom Objects in the person view in Marketo even after setting the Custom Object to show in the people viewer.

SanfordWhiteman
Level 10 - Community Moderator

You should still see the Custom Objects tab. Tell us about this Customer ID field you used as the Link field. It’s a lead (person) field?