Email Scripting and Text-Only | Community
Skip to main content
Mike_Tran1
Level 1
June 24, 2019
Question

Email Scripting and Text-Only

  • June 24, 2019
  • 1 reply
  • 2710 views

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:

TEXT only Version:

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
Level 10
June 24, 2019

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
June 24, 2019

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

SanfordWhiteman
Level 10
June 24, 2019

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.