Email Guided Template Syntax | Community
Skip to main content
Olivia_Piper
Level 3
October 18, 2016
Solved

Email Guided Template Syntax

  • October 18, 2016
  • 5 replies
  • 8524 views

Hi everyone,

Can someone show me an example of how to reference a mktoBoolean id in an email template?

I understand the use of ${idname} and I've tried using it how you would in a landing page template but I can't get it to work?

I've coded my email using CSS rather than in table form, is that my problem?

Any help would be appreciated.

Thanks

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

Thank you @Nicholas Manojlovic for your input. With a bit of playing around I've managed to solve the issue.

Here's what I did to make it work.

First, if the email is built in table form (which most emails are) to hide the section you have to put the id reference, ${idname}, in the table of your content section eg. <table class="${showWebinarMainText}" width="600" cellspacing="0" cellpadding="0" border="0" align="center">. <div> tags do not work for the email template, when I tried Marketo stripped them all out.

One other thing that I came across is that you can hide the section and it renders in most email clients, however, good old Outlook doesn't hide it. So here is the work around.

Code the css with mso-hide for the false_value:

.hide {

      display: none;

      mso-hide: all;

    } 

    .show {

      display: block;

    }

Then add it to your mktoBoolean:

<meta class="mktoBoolean" id="showWebinarMainText" mktoname="Show Webinar Main Text?" default="true" false_value="hide" true_value="show" false_value_name="NO" true_value_name="YES" />

Then reference this in your table using class=:

<table class="${showWebinarMainText}" width="600" cellspacing="0" cellpadding="0" border="0" align="center">

I've never used modules before but looking into it that's what I need! I'm not sure how to use them though. Could you give me an example of how I might code a container and a module into my email template?

Many thanks!

5 replies

Jim_Thao7
Level 8
October 18, 2016

<meta class="mktoBoolean" id="showSection1" mktoName="Show Sec. 1?" default="true" false_value="none" true_value="block" false_value_name="Hide" true_value_name="Show">

Nicholas_Manojl
Level 8
October 19, 2016

This is a good point - this isn't documented on the email syntax page (and it should be in my opinion).

Olivia_Piper
Level 3
October 19, 2016

Thanks to you both for your reply.

Jim,

Thanks for putting this in, however, I understand how to do that bit which is documented on the email syntax page, but what I'm asking is where/ how do I reference the id in the template.

For example do I reference it in CSS e.g

<!--CSS Example-->

<head>

meta class="mktoBoolean" id="showWebinarSection1" mktoName="Show Webinar Sec. 1?" default="true" false_value="none" true_value="block" false_value_name="Hide" true_value_name="Show">

<style>

.showWebinarSection1 {

             display:${showWebinarSection1}

}

</style>

</head>

<body>

<div class="showWebinarSection1">Some Text

</div>

</body>

<!--CSS Example End-->

OR

<!--Inline CSS Example-->

<body>

<div style="display:${showWebinarSection1}">Some Text</div>

</div>

<!--Inline CSS Example End-->

Do I have to use containers like in landing pages or can I use a <table>, <tr> or <td> tags or do I have to create modules?

I agree with you Nicholas, this is not documented anywhere and it should be. There aren't even any discussions on the subject. I'm guessing the reason is that most companies haven't haven't delved too deep into creating full on guided email templates yet as the email editor 2.0 is still quite new.

Jim_Thao7
Level 8
October 19, 2016

Apologies for the misunderstanding.  If you're only looking for editable element sections, you don't actually need any of that.   You can just go ahead and build element containers, so long as you give them a "class" and "mktoName" such as: <div class="mktoText" id="inamedyou" mktoName="inamedyou">inamedyou</div>

If you want the show/hide, you can encapsulate your div container with that meta tag ID.  Here's an example:

__________________________________________

<!DOCTYPE html>

<html>

  <head>

    <meta charset="utf-8">

  <meta class="mktoBoolean" id="showSection1" mktoName="Show Sec. 1?" default="true" false_value="none" true_value="block" false_value_name="Hide" true_value_name="Show">

  </head>

  <body>

    <div id="section1" style="display:${showSection1};">

         <div class="mktoText" id="inamedyou" mktoName="inamedyou">inamedyou</div>

    </div>

   

  </body>

</html>

__________________________________________

One of the ways that I learned (and I'm still learning everyday) is to work backwards.  Go grab some templates, look at the code, copy/paste it out onto your templates section by section and test them out.  This will help you understand it a lot better.  I also do agree that the documentation for this is lacking for sure.  Reverse engineering is the key to everything Marketo doesn't have documented well enough.

Olivia_Piper
Olivia_PiperAuthorAccepted solution
Level 3
October 21, 2016

Thank you @Nicholas Manojlovic for your input. With a bit of playing around I've managed to solve the issue.

Here's what I did to make it work.

First, if the email is built in table form (which most emails are) to hide the section you have to put the id reference, ${idname}, in the table of your content section eg. <table class="${showWebinarMainText}" width="600" cellspacing="0" cellpadding="0" border="0" align="center">. <div> tags do not work for the email template, when I tried Marketo stripped them all out.

One other thing that I came across is that you can hide the section and it renders in most email clients, however, good old Outlook doesn't hide it. So here is the work around.

Code the css with mso-hide for the false_value:

.hide {

      display: none;

      mso-hide: all;

    } 

    .show {

      display: block;

    }

Then add it to your mktoBoolean:

<meta class="mktoBoolean" id="showWebinarMainText" mktoname="Show Webinar Main Text?" default="true" false_value="hide" true_value="show" false_value_name="NO" true_value_name="YES" />

Then reference this in your table using class=:

<table class="${showWebinarMainText}" width="600" cellspacing="0" cellpadding="0" border="0" align="center">

I've never used modules before but looking into it that's what I need! I'm not sure how to use them though. Could you give me an example of how I might code a container and a module into my email template?

Many thanks!

Olivia_Piper
Level 3
October 21, 2016

Just a quick update, I ended up using modules instead of Booleans. So much easier!

October 21, 2016

I'd actually recommend this as well. the "display: none;" property has issues with outlook as well, and when "hiding" something (for example we had a button) in the editor it appears to work, but on a live send to outlook inbox, the item still appears.

Level 2
June 15, 2023

That actually works, but the issue is, when you forward the email once received, all the hidden elements will appear again.