Email Scripting and Text-Only

Mike_Tran1
Level 1

Email Scripting and Text-Only

Hi everyone! I've just started incorporating email scripting into my email templates and I'm running into an issue with the text-only version. It is currently not displaying the content, but rather than token itself. Is there a fix to this?

Here are all the steps that I've taken so far with email scripting.

HTML:

<div class="mktEditable" id="m_button_cta" mktoname="Text">
<a href="${button-link}" target="_blank"style="color: rgb(99, 99, 99); text-decoration: underline; color:#ffffff; font-family:'Proxima Nova', Helvetica, Arial, sans-serif; font-size:13px; font-weight:bold; text-decoration: none; border-radius: 3px; padding: 8px 18px; border: 1px solid #64b245; display: inline-block; letter-spacing:1px;">
${button-text}
</a>
</div>‍‍‍‍‍

META tags:

<meta class="mktoString" id="button-text" mktoname="Button Text" default="CTA TEXT" mktomodulescope="true">
<meta class="mktoString" id="button-link" mktoname="Button Link" default="https://meraki.cisco.com/" mktomodulescope="true">‍‍


Editor Content and Local Variables:
Screen Shot 2019-06-24 at 1.26.42 PM.png
Screen Shot 2019-06-24 at 1.26.48 PM.png

TEXT only Version:
Screen Shot 2019-06-24 at 1.28.58 PM.png

Token Value:

#if($lead.Language__c == "English") LEARN MORE #elseif($lead.Language__c == "French") LEARN MORE #elseif($lead.Language__c == "Spanish") LEARN MORE #elseif($lead.Language__c == "Portugese") LEARN MORE #elseif($lead.Language__c == "German") LEARN MORE #elseif($lead.Language__c == "Japanese") LEARN MORE #elseif($lead.Language__c == "Dutch") LEARN MORE #elseif($lead.Language__c == "Swedish") LEARN MORE #elseif($lead.Language__c == "Chinese") LEARN MORE #elseif($lead.Language__c == "Italian") LEARN MORE #elseif ($lead.Language__c == '') LEARN MORE #else LEARN MORE #end‍

Token Name: my.button-text


Please and thank you for the help!

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Email Scripting and Text-Only

I don't see any Email Scripting (Velocity)? Those are just variables.

Variables don't work in the Text version, last I knew.

Mike_Tran1
Level 1

Re: Email Scripting and Text-Only

Sorry! I realized I didn't add the script and token value.

SanfordWhiteman
Level 10 - Community Moderator

Re: Email Scripting and Text-Only

Make sure you do not have any ${mktoVariables} and {{my.tokens}} with the same name, and that you don't use any Velocity ${variables} that have the same name as external ${mktoVariables}.

Also, for doing simple language matching that code is wickedly wordy and hard to maintain. You want this (assuming of course you'll be actually changing the text per language):

#set( $textByLanguage = {
"English" : "LEARN MORE",
"French" : "LEARN MORE",
"Spanish" : "LEARN MORE",
"Portugese" : "LEARN MORE",
"German" : "LEARN MORE",
"Japanese" : "LEARN MORE",
"Dutch" : "LEARN MORE",
"Swedish" : "LEARN MORE",
"Chinese" : "LEARN MORE",
"Italian" : "LEARN MORE",
"" : "LEARN MORE"
} )
${display.alt($textByLanguage[$lead.Language__c],$textByLanguage[""])}##

Other than that there's nothing that would stop this token from working perfectly fine in the Text version of an email.