SOLVED

Can we target 'Text Only' in Script Tokens?

Go to solution
Anonymous
Not applicable

Can we target 'Text Only' in Script Tokens?

I'm writing a simple script token to write in the appropriate street address dependent on region. The only issue I'm having is that the HTML version requires some non-breaking spaces to prevent some ugly wrapping in Postcodes etc. It would be nice to be able to differentiate HTML & Text Only within the script rather than set up 2 script tokens. Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions
John_Clark1
Level 10

Re: Can we target 'Text Only' in Script Tokens?

Hi Alan,

I don't believe there is any way to do this.  The token will populate the same way no matter where you use it, and there isn't a way to tell the system in which version of the email it's being used.

John

View solution in original post

10 REPLIES 10
John_Clark1
Level 10

Re: Can we target 'Text Only' in Script Tokens?

Hi Alan,

I don't believe there is any way to do this.  The token will populate the same way no matter where you use it, and there isn't a way to tell the system in which version of the email it's being used.

John

Anonymous
Not applicable

Re: Can we target 'Text Only' in Script Tokens?

Thanks John,

That seems to confirm my suspicions. Looks like a feature request to me 🙂

... if they could just move where the token is evaluated!

A

PS I'll be using 2 tokens until then!

Anonymous
Not applicable

Re: Can we target 'Text Only' in Script Tokens?

Just to wrap this up. I've marked John's answer as correct. I submitted this as an idea and got the 'WE LIKE IT, BUT IT IS COMPLICATED' flag.

Anonymous
Not applicable

Re: Can we target 'Text Only' in Script Tokens?

My understanding is that Velocity script is evaluated on the server when the email is being 'constructed' for a lead. Also, many times the actual email is sent as 'multi-part MIME' i.e. the email is sent as both html and text. It is upto the email client to display appropriate version based on its capabilities / security policies etc. That is why able to differentiate HTML & Text Only within the script may not be possible.

Rajesh

Anonymous
Not applicable

Re: Can we target 'Text Only' in Script Tokens?

Thank for your contribution Rajesh 🙂

Yes all understood concerning the email client displaying the appropriate version. This shouldn't be a barrier to achieving the results I'm suggesting server-side. The content in the script is still processed and injected the email... in the html and the text only versions. An example of a workaround would be running the script twice during the creation of the email server-side. Once for text only and again for html. You could then inject the different results into the relevant parts.

I'm not saying this is an easy task. It may involve a write. The there may be performance/optimisation considerations. I'm saying that if there was a will to do this and enough demand to make it worthwhile it could be done.

Justin_Cooperm2
Level 10

Re: Can we target 'Text Only' in Script Tokens?

Well, you can make an email script token and then insert it only in the Text side of the email. You can also then make the email text only if you want to. Completely up to you!

Anonymous
Not applicable

Re: Can we target 'Text Only' in Script Tokens?

Justin Cooperman​ - is that really so? From what I experience and have heard from Marketo Support, email script tokens don't work at all in the text side of emails. For our specific use case that is especially problematic with regards to the subject line - which doesn't populate at all on the text side if generated through a script token. Or am I missing something?

Justin_Cooperm2
Level 10

Re: Can we target 'Text Only' in Script Tokens?

I just tested it and it works fine in the text side.

Anonymous
Not applicable

Re: Can we target 'Text Only' in Script Tokens?

Justin is right. We are successfully using a script token for the address in the Text Only version of our email.