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

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

Anonymous
Not applicable

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 - Community Moderator

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?

Nicholas_Manojl
Level 9

Just on this point, how does one iterate over an object in the scripting panel.

I just tried

#foreach ($x in {object_cList.get(0).fullName})

<li>$x</li>

#end

but couldn't figure it out quickly enough.

Nicholas_Manojl
Level 9

Oops. Obvious mistake, I have it now.

It should be

#foreach ($x in {object_cList})

<li>$x.firstName</li>

SanfordWhiteman
Level 10 - Community Moderator

So is the live VTL execution working for you but not for Denise, even though you're both on 2.0? We have to get to the bottom of that!

Nicholas_Manojl
Level 9

Yes, absolutely.

pastedImage_0.png

pastedImage_1.png

Anonymous
Not applicable

It's the content of a {{my.token}}. It's the entire content of the {{my.token}}. I dragged the relevant field from the custom object into the email script token - which resulted in the box next to the field being checked. Is that what you meant by "making sure to check off the Aircraft object is passed"? (I was just hoping I would get lucky and it would work without my needing to add Velocity script - which I do not know).

SanfordWhiteman
Level 10 - Community Moderator

You are adding Velocity script: ${blahblah} is VTL.

You may not want to add any more VTL but to be clear, you are always using VTL when you use any reference like that.

Anonymous
Not applicable

Thanks. What I meant was - I was hoping that simply dragging in the field would make the token populate the value in the field. Either that isn't the case or, as you and Rajesh suggest, an email script field token doesn't render with preview. If the problem is that dragging in the field isn't sufficient to populate the token with the value in the field, can you tell me what to add to make it so?

I.e., the field name is "Tail Number." It's a text field and I want the content (the actual tail number) to populate the token.

SanfordWhiteman
Level 10 - Community Moderator

I would suggest you send create a test Velocity token that does not rely on custom objects, which add a lot of complexity (and you need to have sample objects in order to test).

For example, simply output

     ${lead.FirstName}

I am not convinced that VTL now executes in preview mode. If it does, you will see the lead's first name.

Anonymous
Not applicable

Good idea. I tried that and it didn't populate. Thank you!

SanfordWhiteman
Level 10 - Community Moderator

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.

Anonymous
Not applicable

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}."

Anonymous
Not applicable

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.

SanfordWhiteman
Level 10 - Community Moderator

Jamie, have you tested this with Velocity scripts?

Anonymous
Not applicable

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