Is there some clever way to preview how a token will be populated? | Community
Skip to main content
August 9, 2016
Question

Is there some clever way to preview how a token will be populated?

  • August 9, 2016
  • 4 replies
  • 4985 views

I'm working in a Marketo instance with a custom object synced from SFDC. This is the first time I've gotten to work with custom objects. We want to send an email that includes a token for a field inside the custom object. I have just learned that I can create such a token with an email script token. Fun stuff! However, I can't use this unless I can test it first to make sure it will populate the way I intend. Short of creating an Account and Contact in SFDC with a populated custom object to be used for test purposes - can anyone think of way to preview the populated email without actually sending it? In other words, Contact "Samantha" has the custom object attached. I created an email script token referencing field xyx in the custom object. I want to be able to verify how my email script token populates if I send the email to Samantha. Is there any way to do that?

Thank you!

Denise

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

4 replies

August 9, 2016

Yes, this is done in the preview pane then select the view by drop down and view by a specific lead or view by a list.

If you have a test lead in your database you can just pick that lead and the email preview will populate with the lead data.

The list will just be a list of test leads that you can scroll through to see the data change.  This is great to make sure the personalization is working correctly.  It has to be a static list though, can't be a smartlist.

August 9, 2016

Thank you, Jamie! That's just what I need! That feature wasn't there in Email 1.0, was it?

SanfordWhiteman
Level 10
August 9, 2016

Nope.

Even in a Velocity (email scripting) sandbox, sample objects need to exist to see the sample output. You really should always have test contacts if using Custom Objects anyway.

August 9, 2016

The sample object DOES exist - I just didn't realize I could preview the email as it would appear to a specific lead. So now that I've done that I realize I have to learn how to use Velocity scripting because my wonderful token just populates as "${Aircraft__cList.get(0).Name}."

August 9, 2016

From my understanding, the email script gets 'executed' on the Marketo server when Marketo actually constructs the email to send out. So the 'preview' does now render the email scripting related output if you are testing it using email editor preview.

As Sanford said here, create a test lead, have a couple of test custom records populated for that test lead and 'actually' launch a 'test' smart campaign to that test lead. That is how I have been doing it.

Rajesh Talele

August 9, 2016

Hi Rajesh!

When you said "So the 'preview' does now render the email scripting related output if you are testing it using email editor preview." Did you mean to say "So the 'preview' does NOT render the email scripting related output if you are testing it using email editor preview"?

The preview rendered the token as "${Aircraft__cList.get(0).Name}." Doesn't that mean I didn't create it properly rather than that the token isn't populated until the Marketo server sends it?

Thank you,

Denise

SanfordWhiteman
Level 10
August 9, 2016

The preview rendered the token as "${Aircraft__cList.get(0).Name}." Doesn't that mean I didn't create it properly rather than that the token isn't populated until the Marketo server sends it?

Did you just add the text ${Aircraft__cList.get(0).Name} directly to the body of the email (which will never work)?  Or is this the content of a {{my.token}} that you have separately set up in the Tokens tab, making sure to check off that the Aircraft object is passed to Velocity?

August 9, 2016

For the benefit of anyone looking for an answer to the same situation - how to preview how a token will render for a specific recipient (only with the added wrinkle that the token is an email script token):

1) Jamie Lewis's response is correct for normal tokens - but not for email script tokens:

"Yes, this is done in the preview pane then select the view by drop down and view by a specific lead or view by a list.

If you have a test lead in your database you can just pick that lead and the email preview will populate with the lead data.

The list will just be a list of test leads that you can scroll through to see the data change.  This is great to make sure the personalization is working correctly.  It has to be a static list though, can't be a smartlist."

2) Sanford and Rajesh are correct the email script tokens will not render (populate) in preview.

Nicholas_Manojl
Level 8
August 10, 2016

I'm confused. I think Jamie is correct in saying that if you select the "List" or "Lead" section of the email preview, the email is constructed and you can view the preview as you intend it. This is documented:

http://developers.marketo.com/documentation/velocity-script/

"You can also use the Email Preview to test your script.  To do so, you must select View As: Lead Detail, and select a lead from an available static list.  This has the added benefit of outputting any exceptions that may have occurred during script execution:"

August 10, 2016

The link you are referring to recommends testing with a sample email.  I guess you cannot preview a script token.