I am using a few variables to control certain aspects of the layouts of my email modules.
When I try to approve the template I am receiving the error message 'Variable Not Defined: copySectionMarginBottom'
I find when I change the order of the meta tags, sometimes 'copySectionMarginTop' will not be defined, or one of the other variables I have defined in the head will error out instead.
When I change the id in the body code (to something like ${copySectionMarginBottomTest}) I get the inline error in the code editor. I can fix it back and the inline error goes away, but still throws a validation error when I try to approve the template.
Any help would be appreciated.
I am using this code
HEAD:
<meta class="mktoNumber" id="copySectionMarginTop" mktoName="Margin Top" default="0" min="0" max="30" units="" step="1" mktoModuleScope="true" />
<meta class="mktoNumber" id="copySectionMarginBottom" mktoName="Margin Bottom" default="15" min="0" max="30" units="" step="1" mktoModuleScope="true" />
BODY CONTAINER:
<table id="container" class="mktoContainer" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr class="mktoModule" id="singleColumnModule" mktoName="Single Column Module" mktoAddByDefault="true" >
<td>
<table>
<tr>
<td style="line-height: 0;padding:0;" height="${copySectionMarginTop}"> </td>
</tr>
<tr>
<td style="padding: 0;">
<table style="background-color: white;">
<tr>
<td width="15"> </td>
<td width="10" class="em_hide"> </td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="color: #494848;font-family:Arial,Helvetica,sans-serif;" class="mktoText" id="singleColumnText" mktoName="Single Column Text">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sint adipisci assumenda distinctio quam perferendis quia unde doloribus hic ipsa et? Quod doloremque animi, similique omnis dolor iusto maiores eligendi autem.
</td>
</tr>
</table>
</td>
<td width="10" class="em_hide"> </td>
<td width="15"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="line-height: 0;padding:0;" height="${copySectionMarginBottom}"> </td>
</tr>
</table>
</td>
</tr>
</table>
Solved! Go to Solution.
Thank you for your reply Greg,
I think this problem is caused by a No-Break Space (U+00A0) after the closing brace of my meta tags.
I find the online editor a little frustrating without code folding support etc. so I use my own editor to do work and copy paste the code into the online editor. I think this process introduced some invisible characters that broke the HTML parser.
The code seems good.
The problem might be elsewhere.
Can you please provide the complete code of the template ?
-Greg
Below is the full template. I have added a couple new variables. I have been able to get this to validate. I notice that when I add a new variable to the head, the new variable does not validate. When I switch the order of the variables, different sets of them will be invalid seemingly randomly.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:v="urn:schemas-microsoft-com:vml"><head> <title></title> <meta class="mktoString" id="HEROALT" mktoName="Hero Alt Text" default="Lorem Ipsum" />
<meta class="mktoColor" id="BACKGROUNDCOLOR" mktoName="Background Color" default="#330072" mktoModuleScope="true" />
<meta class="mktoString" id="CTALINK" mktoname="Button Link" default="https://www.example.com" mktoModuleScope="true" />
<meta class="mktoString" id="CTATEXT" mktoname="Button Label" default="CTA text" mktoModuleScope="true" />
<meta class="mktoNumber" id="CTAHEADINGFONTSIZE" mktoName="Heading font size" default="30" min="20" max="45" units="px" mktoModuleScope="true" />
<meta class="mktoNumber" id="COPYSECTIONMGNTOP" mktoName="Margin Top" default="0" min="0" max="45" mktoModuleScope="true" /> <meta class="mktoNumber" id="COPYSECTIONMGNBTM" mktoName="Margin Bottom" default="30" min="0" max="45" mktoModuleScope="true" />
<meta class="mktoNumber" id="HEADLINEMGNTOP" mktoName="Headline Margin Top" default="0" mktoModuleScope="true" /> <meta class="mktoNumber" id="HEADLINEMGNBTM" mktoName="Headline Margin Bottom" default="0" mktoModuleScope="true" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0 " />
<style type="text/css"> a[x-apple-data-detectors] {
color: inherit !important; text-decoration: none !important; font-size: inherit !important; font-family: inherit !important; font-weight: inherit !important; line-height: inherit !important; }
body {
margin: 0 !important; padding: 0 !important; -webkit-text-size-adjust: 100% !important; -ms-text-size-adjust: 100% !important; -webkit-font-smoothing: antialiased !important; font-family: sans-serif; overflow-x: hidden; color: #494848; font-size: 16px; }
.button_container {
width: 232px; }
img {
border: 0 !important; outline: none !important; }
p {
margin: 0; padding: 0; }
table {
border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; border-spacing: 0; table-layout: fixed; }
.sup {
-webkit-text-size-adjust: none; }
td, a, span {
border-collapse: collapse; mso-line-height-rule: exactly; /*padding: 0;*/ border-spacing: 0; }
td {
padding: 0; text-align: left; }
.em_height_24 {
height: 24px !important; }
.em_width_58 {
width: 58px !important; border-collapse: collapse; }
.em_width_43 {
width: 43px !important; border-collapse: collapse; }
.em_width_36 {
width: 36px !important; border-collapse: collapse; }
.em_height_17 {
height: 17px !important; border-collapse: collapse; }
.em_height_2 {
height: 2px !important; border-collapse: collapse; }
.em_height_12 {
height: 12px !important; border-collapse: collapse; }
.em_width_16 {
width: 16px !important; }
.em_width_20 {
width: 20px !important; }
.em_height_41 {
height: 41px !important; }
.footer-copy {
text-align: center !important; }
.em_show {
display: none; }
@media only screen and (max-width: 480px) {
.button_container {
width: 260px; }
.em_main_table {
padding: 0 10px !important; width: 100% !important; }
.em_wrapper {
width: 100% !important; }
.em_show {
display: table-cell; }
.em_wrapper_22 {
width: 100% !important; margin-bottom: 22px !important; }
.em_wrapper_15 {
width: 100% !important; margin-bottom: 15px !important; }
.em_height_41 {
height: 18px !important; }
.em_hide {
display: none !important; }
.em_align_center {
text-align: center !important; }
.em_pad_top {
padding-top: 20px !important; }
.em_pad_top {
padding-top: 20px !important; }
.em_bg_center {
background-position: center !important; }
.em_full_width {
width: 100% !important; height: auto !important; max-width: 100% !important; }
.em_pad_btm {
padding-bottom: 29px !important; }
.em_side_space {
padding-left: 20px !important; padding-right: 20px !important; }
.em_logo_center {
text-align: center !important; margin: auto; width: 168px; }
.em_red_box_center {
width: 70%; }
.em_width_60 {
width: 15px !important; }
.em_width_30 {
width: 15px !important; }
.em_height_41 {
height: 15px !important; }
.max_width_250 {
max-width: 250px !important; }
a.font_size_12 {
font-size: 12px !important; text-align: center !important; white-space: normal !important; }
.em_600_hide {
display: table !important; width: 100% !important; }
.em_600_hide2 {
display: table !important; width: 100% !important; }
.em_inner_table {
width: 90% !important; }
.float-right {
float: none !important; width: 100% !important; }
.float-left {
float: none !important; width: 100% !important; }
}
@media only screen and (min-width: 480px) and (max-width: 620px) {
.em_main_table {
width: 100% !important; }
.em_show {
display: table-cell; }
.em_inner_table {
width: 90% !important; }
.em_wrapper {
width: 100% !important; }
.em_hide {
display: none !important; }
.em_hide_medium {
display: none; }
.em_height_41 {
height: 18px !important; }
.em_align_center {
text-align: center !important; }
.em_pad_top {
padding-top: 20px !important; }
.em_side_space {
padding-left: 20px !important; padding-right: 20px !important; }
.em_bg_center {
background-position: center !important; }
.em_full_width {
width: 100% !important; height: auto !important; max-width: 100% !important; }
.em_pad_btm {
padding-bottom: 17px !important; }
.em_logo_center {
text-align: left !important; }
.em_red_box_center {
width: 45%; }
.em_wrapper_22 {
width: 100% !important; margin-bottom: 22px !important; }
.em_wrapper_15 {
width: 100% !important; margin-bottom: 15px !important; }
.max_width_250 {
max-width: 250px !important; }
.em_600_hide {
display: table !important; width: 100% !important; }
.em_600_hide2 {
display: table !important; width: 100% !important; }
.float-right {
float: none !important; width: 100% !important; }
.float-left {
float: none !important; width: 100% !important; }
}
.float-right {
float: right; -webkit-margin-start: 0 !important; -webkit-margin-end: 0 !important; }
.float-left {
float: left; -webkit-margin-start: 0 !important; -webkit-margin-end: 0 !important; }
@media only screen and (min-width: 620px) {
.em_600_hide2 {
display: none !important; }
.font_size_12 {
white-space: normal !important; }
.em_left_padding_35 {
padding-left: 35px; }
.em_right_padding_5 {
padding-right: 5px; }
.em_orange_border_left {
border-left: 1px solid #E86B1D; }
.em_hide_large {
display: none; }
.footer-copy {
text-align: left !important; }
.em_show {
display: none; }
}
</style> <!--[if gte mso 12]> <style type="text/css"> sup { font-size: 100% !important; } .hide-on-mso { display: none !important; mso-hide: all !important; } </style> <![endif]--></head><body style="margin:0; padding:0;background-color:#e1daea;width:100%;" width="100%" align="center"><!--<span class="preheader" style="display: none! important; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0; mso-hide: all;">Introducing example<sup>™</sup></span>--> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="width:100%;background-color:#e1daea;padding:0;text-align:center;"> <tr> <td class="em_show" width="15"> </td> <td align="center" valign="top" bgcolor="#e1daea" style="text-align:center;background-color:#e1daea;padding: 0;"> <table align="center" class="em_main_table" width="620" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed;padding:0;margin: 0 auto;" bgcolor="#e1daea"> <!-- TOP MESSAGE --> <tr> <td> <table align="center" width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="20"> </td> <td height="70" align="center" style="text-align:center;"> <p style="font-size:13px;color:black;margin:20px 0;"> If this message is not displaying properly,
<a style="color:#f58d2e;text-decoration: underline;" href="{{system.viewAsWebpageLink}}">view it online</a>.
</p> <p style="font-size:13px;color:black;margin:20px 0;"> Please see <a href="https://www.example.com" target="_blank" style="color:#f58d2e;text-decoration: underline;">full Prescribing Information</a>, <a href="https://www.example.com/" target="_blank" style="color:#f58d2e;text-decoration: underline;">Instructions for Use</a>, and
<a href="https://www.example.com/wp-content/themes/example/assets/pdf/example_Patient_Information.pdf" target="_blank" style="color:#f58d2e;text-decoration: underline;"> <nobr>Patient Information</nobr> </a>.
</p> </td> <td width="20"> </td> </tr> </table> </td> </tr> <!-- /TOP MESSAGE --> <!-- Hero IMAGE --> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="top" bgcolor="#330072"> <div class="mktoImg" id="heroImage" mktoName="Hero Image" mktoImgLink="https://www.example.com" mktoImgWidth="100%" mktoImgLinkTarget="_blank" mktoImgSrc="http://pages.example.com/"> <a><img alt="${HEROALT}" style="width:100%;"></a> </div> </td> </tr> </table> </td> </tr> <!-- / Hero IMAGE --> <!-- PURPLE SECTION 2 --> <tr> <td style="background-color:#330072;"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td> <table width="90%" align="center" style="border-top: 1px solid #ffffff;"> <tr><td style="line-height:0;" height="30"> </td></tr> <tr> <td class="mktoText" id="heroEyebrow" mktoName="Hero Eyebrow" style="font-size:16px;font-weight:bold;color:#ffffff;text-align: center;width:90%;font-family:Arial,Helvetica,sans-serif;" align="center" width="90%"> <p style="margin-bottom: 15px;">I am an eyebrow</p> </td> </tr> </table> </td> </tr> <tr> <td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="15"> </td> <td width="30" class="em_hide"> </td> <td align="center" style="text-align:center; font-size: 25px; color: white; font-weight:bold; margin: 0; line-height:1.4;font-family:Arial,Helvetica,sans-serif;" class="mktoText" id="MAINHEADLINE" mktoName="Main Headline"> Lorem ipsum dolor sit amet, consectetur adipisicing elit.
</td> <td width="30" class="em_hide"> </td> <td width="15"> </td> </tr> </table> </td> </tr> <tr> <td height="10"> </td> </tr>