Tricky one here. I've used an email token to spit out a variable in an email program. But in Apple Mail and Outlook 2014 there are weird spaces inserted before and after the token. See below.
The token is £100 GBP. The random spaces are definitely not part of the code.
Weird things I found out:
* When I simply put the plain text of "£100 GBP" as the output of the email script, the weird spaces remain. So it's nothing to do with my code.
* When I use a Plain Text token instead of an Email Script token (effectively making the token static), it works fine.
This might be something purely in Apple Mail and Outlook (it looks fine in Outlook365.com, interestingly enough), but in any case I can't risk it. I had to use an alternative subject line instead of something dynamic.
Has anyone encountered this before? I've asked Support but basically since it's to do with email rendering they have said they can't help me.
Did you try making the entire string part of your Email Script token, not just the £100 GBP ? I'd try that to see if it alleviates the rendering issue.
Weirdly, that's giving me a different error. Every variant has a currency in it (either a dollar, pound or euro sign) and when I put the entire string in the email script output, then put only the token in the subject line, then it either:
1. Shows "£100" if the string was meant to be "(string) £100 GBP (string)"
2. Shows "100" if the string was meant to be "(string) $100 (string)"
I think this is because Velocity is interpreting the string as purely the variable name. For example, I'm using lines such as:
#set ($LifetimeDepositFormatted = "Don't forget your £100 GBP Lifetime Deposit!") or
#set ($LifetimeDepositFormatted = "Don't forget your $250 NZD Lifetime Deposit!")
This might be interacting with the subject line in strange ways.
Innnnnnteresting. I don't know why, but here could be some guesses for troubleshooting and finding the problem.
Can you count the number of spaces? Could be the scripting token is counting whitespace and rendering it in the subject line. Aka something like "echo '$100';" might count an extra whitespace.
Do you have the same problem if you just output the response (no code in the email script) with just "100" and not the special character?