Extra whitespaces surrounding tokens

Highlighted
Anonymous
Not applicable

Extra whitespaces surrounding tokens

Hello.

I'm trying to use tokens in my emails, but I encountered with following problem: when I write sth like "{{my.token}}." there is a space between my token and a dot in a resulting email. As I understand it's because of line breaks that surround subsituted token in html code of email.

Is there any way to get rid of that line breaks and that space character?

Thanks!

20 REPLIES 20
Highlighted
Level 6

Re: Extra whitespaces surrounding tokens

Can you provide screenshots or examples of what the value of your token is and how it resolves?

Are you saying that {{my.token}} where the token value = "something" resolves as "something ."?

Highlighted
Anonymous
Not applicable

Re: Extra whitespaces surrounding tokens

Nope, {{my.token}}. renders as "something ." (note the space before dot). In the example below, the price is my token and there is an extra space between dot and token, which is missing in the email editor. Screenshot from 2016-08-16 11-34-04.png

Screenshot from 2016-08-16 11-35-37.png

In the HTML code of rendered email you can see a linebreak right after my token which results in a space between token and dot

Screenshot from 2016-08-16 11-38-50.png

Highlighted
Level 6

Re: Extra whitespaces surrounding tokens

I feel like maybe there is a hidden character here.  Was the value "(US $89.00 per year)" copied over from somewhere? Perhaps you also copied over a hidden character of some sort. 

I would recommend that you retype this value out manually into the token to see if that helps.  Similarly, try copying and pasting this into notepad 2 or notepad++ to see if the hidden character can be revealed.

Highlighted
Anonymous
Not applicable

Re: Extra whitespaces surrounding tokens

As I understand it's because of line breaks that surround subsituted token in html code of email.

Are these line breaks your additions to the HTML, or are you saying they are contained in the field (for example, a field that originated from a textarea)?

If they're in the HTML, remove 'em!

If they're in the field, you can pass the field through a Velocity (email scripting) template to massage the data, if necessary.

Highlighted
Anonymous
Not applicable

Re: Extra whitespaces surrounding tokens

Nope, I suggest that these linebreaks are added by Marketo. The possible solution is to add the dot to the token but it reduces it's flexibility (for example, if I want to use that token in the middle of a sentence and at the end of it, I'll need to create two tokens instead of one)

Highlighted
Level 10 - Community Moderator

Re: Extra whitespaces surrounding tokens

Text {{my.tokens}} don't just add linebreaks.  Please go to Email Actions >> HTML Tools >> Download HTML and post a snippet of several lines before and after the token is inserted.

Highlighted
Anonymous
Not applicable

Re: Extra whitespaces surrounding tokens

We're having this same issue with a token we use for Business Name. In every instance, the token is showing the business name fine with no extra spaces before it or after it, but when we try and use the biz name right before punctuation it adds a space (not a line-break, but a space). We have confirmed this space does not exist in the html.

How it's Coded:

<div style="font-size: 16px;">Would you like to track when and how OURCOMPANY drives potential customers to {{my.account_name}}? <a href="URLHERE">Visit the Activity Page</a> to view more information about the customers connecting with your business:</div>

How It Appears: 

Would you like to track when and how OURCOMPANY drives potential customers to FAKE NAME ?

As you can see, it's adding a space when used before punctuation. It doesn't do this anywhere else it's used.

Highlighted
Level 10 - Community Moderator

Re: Extra whitespaces surrounding tokens

Is this a Text token or is it an Email Script (Velocity) token?

Highlighted
Anonymous
Not applicable

Re: Extra whitespaces surrounding tokens

Email Script/Velocity token.