SOLVED

Re: Text version of emails not token-friendly

Go to solution
Anonymous
Not applicable

Whenever we use tokens in our emails and I create a text version (we have Email Editor 2.0 enabled), the token works fine in the HTML email, but shows up as a bunch of code in the text version.

Is anyone else having this problem? Does anyone have any solutions?

Thanks,

Nick

Tags (1)
1 ACCEPTED SOLUTION
Josh_Hill13
Level 10 - Champion Alumni

So the quick fix is to have a Text token that has similar content....if you don't want to fix the code or script anything.

View solution in original post

15 REPLIES 15
Anonymous
Not applicable

Hi Nick,

Go to Admin > Email > Edit Text Editor Settings > Root Block Elements > Email / Snippet Editor and you probably want "None".

Rachel_Noble
Level 10 - Champion Alumni

Hi Nick and Tony,

We are having the same issues. Updating the Root Block Elements>Email / Snippet Editor to "None" didn't solve it. Bummer. Any other suggestions?

Thanks!

SanfordWhiteman
Level 10 - Community Moderator

What result are you guys expecting from a Rich Text (i.e. HTML) token in a non-HTML email?

Rachel_Noble
Level 10 - Champion Alumni

I know it's not designed to work this way, but it would be nice if the "Copy from HTML" functionality formatted the rich text to plain text like it does when you click that button for non-tokenized text in the email body.

SanfordWhiteman
Level 10 - Community Moderator

But that wouldn't affect the token value as it changes over time, just the the token name (which is kind of the idea of tokenization, that a change immediately propagates).

Rachel_Noble
Level 10 - Champion Alumni

Hopefully I'm just missing something. In the text editor, my rich text program token looks like this:

Token:

pastedImage_2.png

Text version of email using token:

pastedImage_0.png

That's great. But when I preview or actually send the email, some of the HTML formatting comes over as plaintext:pastedImage_1.png

Even after the change Tony suggested.

SanfordWhiteman
Level 10 - Community Moderator

BTW I just figured out how to have a single script token that switches between HTML and text output based on where it appears. Justin Norris​ you're gonna like this one.

Justin_Norris1
Level 10 - Champion Alumni

So the email script token contained in the text version of the email will render plain text and the same token on the HTML side will render formatted HTML?

That's pretty cool. Post an example!

SanfordWhiteman
Level 10 - Community Moderator

This is the expected behavior.

At runtime (send time) the HTML is not down-shifted into a text representation. Nor, in a wide range of cases, would you want it to be. Try running textContent() on a link that wraps text, for example.  You'll get all the inner text, including carriage returns, and none of the HTML-based formatting, like margins and paragraph containers, that stops words from running together. It's not a conversion that's safe to make without hand-editing (you can still edit the text version of an email, but you wouldn't ever be able to edit the automatic text-ifying of an HTML token).

Josh_Hill13
Level 10 - Champion Alumni

So the quick fix is to have a Text token that has similar content....if you don't want to fix the code or script anything.

SanfordWhiteman
Level 10 - Community Moderator

Yep! Should have made that clear. If you don't want to build a "polymorphic" token you need an HTML token and a Text token.

nikhil001
Level 2

@SanfordWhiteman Could you please let me know the code for single script token that switches between HTML and text output based on where it appears.

SanfordWhiteman
Level 10 - Community Moderator
Josh_Hill13
Level 10 - Champion Alumni

are you using a rich text token or text only? Are you saying you created a text version of the email and the token?

When you test it, do you run a sample or a live email to your seed list?

Anonymous
Not applicable

Hi Josh,

The tokens that seem to be the issue are rich text tokens. And I am referring to the text version of the email. It will copy automatically from HTML, but the tokens will show up as HTML code in both the Marketo previewer and in the test email I send myself.