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?
Solved! Go to Solution.
That seems to confirm my suspicions. Looks like a feature request to me 🙂
... if they could just move where the token is evaluated!
PS I'll be using 2 tokens until then!
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.
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.
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.
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!
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?