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

Anonymous
Not applicable

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

37 REPLIES 37
Anonymous
Not applicable

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.

Anonymous
Not applicable

That clarifies it

Anonymous
Not applicable

I'll have to study this when my brain is fresh. Appreciate all the help!

In the meantime, my use case went away because each of the customers our email needs to target have multiple tail numbers and it's only a subset of them that apply. So I see no way to pull the right tail numbers out of the custom object. However, I'm interested in understanding how to use Email Script Tokens properly and get them to preview correctly in any case!

I may post my current dilemma to a new thread.

Nicholas_Manojl
Level 9

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:"

Anonymous
Not applicable

I don't see View As: Lead Detail as an option. The only View As options I see are: Default, Lead, List.

By the way, what's the link to your post with the big pull quote?

I did try putting myself in a static list and using the email script token that Sanford created, which consisted of: ${lead.FirstName}

But it doesn't populate on preview.

Nicholas_Manojl
Level 9

I bet that is because you haven't got the checkbox selected for First Name in the email script editor.

Anonymous
Not applicable

You were right - but now it's checked and it makes no difference. Do I need to put something else in the email script token besides this?

${lead.FirstName}

@Sanford - I'm definitely using Email 2.0.

SanfordWhiteman
Level 10 - Community Moderator

That should be fine.  Output should be same as the regular {{lead.First Name}} token.

Since you're having trouble finding the Preview-as-Lead functionality, have you just sent an email (not a sample) to someone with a First Name?

Anonymous
Not applicable

I wasn't having trouble finding Preview-as-Lead - I couldn't find Preview-as-Lead-Detail (because it doesn't exist). At any rate, my test is working now! Woo-hoo! Now I can go to bed without fretting about this.

You guys are coding wizards and are inspiring me to want to learn!

Nicholas_Manojl
Level 9

It seems to be a typo in the documentation. It should be:

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

Anonymous
Not applicable

Hi There - Just to close the loop on the instructions - Nicholas's correction is correct. The instructions as-written accurately describe how to preview tokens on a landing page (as opposed to an email).

Anonymous
Not applicable

Yes, I think you are correct about the documentation.

And guess what? My First Name Email Script Token is working now!!!! Yay!! I'm not sure what happened. My guess is that I forgot to save it after I fixed the check box.

I'm intrigued now! What do people commonly use email script tokens for? They only came up for me because of the custom object.

Nicholas_Manojl
Level 9

I use it for conditional content a lot using the IF/ELSE functionality.

ie,

IF product = xyz

print some info here...

ELSE product = abc

print something else here.

I generally find it's easier to do this than setup another segmentation. Campaign Monitor has a much more user friendly interface by the way, with inline conditional formatting but that's another story.

And as you mentioned, it is the only way to access the data in a custom object in an email.

Nicholas_Manojl
Level 9

I also have a script which corrects the first initial of a name to a capital, which I use with caution but which is generally useful nonetheless.

There are a few other examples on this community floating around, some of which I think are a bit naff but others which are very useful.

SanfordWhiteman
Level 10 - Community Moderator

Denise GreenbergNicholas Manojlovic​ this discussion spurred me to put up a blog post I've been wanting to do for a long time: http://blog.teknkl.com/hide-email-script-my-tokens-in-marketos-web-page-view/

Nicholas_Manojl
Level 9

oh my god.. I didn't know that..

That is definitely getting priority on the list. I am finding myself using email scripts a lot.

SanfordWhiteman
Level 10 - Community Moderator

Welcome (again) to "Things only 2 people in the world know about."

SanfordWhiteman
Level 10 - Community Moderator

If you don't see what Nicholas is seeing, and you're sure you're looking in the same part of the editor, maybe you should open a case.

He was referring to the documentation which backs up Jamie's original response.

NOTE: The original version of this response referred to Editor 2.0, but this works in Editor v1 as well -- for me at least.

Anonymous
Not applicable

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

Nicholas_Manojl
Level 9

Did you read the big pull quote in my post?