Can you segment tokens based on custom objects. | Community
Skip to main content
July 17, 2017
Question

Can you segment tokens based on custom objects.

  • July 17, 2017
  • 2 replies
  • 3360 views

I want to be able to send subscribers a certain token based off of an action in their past history. Is anyone familiar with this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

SanfordWhiteman
Level 10
July 17, 2017

You can segment based on CO presence/properties, yes. And you can also use Velocity to display conditional content based on COs. Not sure what you're specifically trying to do. More detail would help.

July 17, 2017

Hi Sanford,

I actually need to rephrase my question. I created a custom object and a message body field which has HTML text in it. How can I add a token to my email that will pull the field of the custom object with the HTML?

SanfordWhiteman
Level 10
July 17, 2017

I created a custom object and a message body field which has HTML text in it. How can I add a token to my email that will pull the field of the custom object with the HTML?

Use a Velocity ("Email Script") token: Velocity has access to your COs and their fields. They're presented as a (zero-indexed) array of objects (technically, Java ArrayList) when you drag them into the Script Editor.

You can see a bunch of my sample code if you search the Community.

SanfordWhiteman
Level 10
July 19, 2017

Trackable links when emitted from Velocity need to follow certain formats. I've written a lot about such things on my blog (blog.teknkl.com/tag/velocity) and here on the Nation.

July 19, 2017

Hi Sanford,

I want to clarify what were doing.

We have a block of HTML that contains links in a field and we are pulling that field into our email via a token. When we send the test the links are not converting to Marketo trackable links.

This is how we need it to render:

This is how it renders with the tokens:

SanfordWhiteman
Level 10
July 19, 2017

You should probably read my posts on emitting multiple tracked links from Velocity. In general, if you're not very familiar with VTL you shouldn't have more than 1 link emitted from each token. When you have multiple links (as in your multiple Read More links) you need to use different Velocity $variables for each. It does all work but you need to dig in pretty deep.