SOLVED

Re: Email Guided Template Syntax

Go to solution
Olivia_Piper
Level 3

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

1 ACCEPTED SOLUTION
Olivia_Piper
Level 3

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!

View solution in original post

15 REPLIES 15
Olivia_Piper
Level 3

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

Janine_Willis
Level 2

@Olivia Piper For clarification, you just ended up creating a module without the item rather than try to provide the hide functionality as a Local Variable? I am trying to give the option to hide a button in a hero module without creating a second module that doesn't have it. We already have so many modules in our one master template!

Olivia_Piper
Level 3

Hi Janine Willis​,

I did use booleans within the modules, such as building a hero banner including a button with show/ hide functionality.

Here is some code you could use (if you are building your email with tables):

Place this in the <head> tag:

<meta class="mktoBoolean" id="showheroButton" mktoname="Show Hero Button?" default="true" false_value="none" true_value="table-cell" false_value_name="NO" true_value_name="YES" />

For the button, create a table within the main table of the module. Place the following in the surrounding <td> of the button table:

style="display:${showheroButton}"

You will also need to use the following CSS:

.none, .none table { mso-hide: all;}

This ensures that Outlook will hide the table correctly.

I hope this helps!

Sandeepkumar2
Level 2

I agree, it will hide the element but when we forward the email, it will show the hidden element again.

Inga_Romanoff12
Level 1

Hi Olivia, where did you place the ".none, .none table {mso-hide: all;}" CSS? I am trying to add some boolean variables to CTAs in an email template, and have struggled with the Outlook issue.

What I'm confused by is where you got the class name ".none"?

Thank you!

Sandeepkumar2
Level 2

.none, .none table {mso-hide: all;} this should be inside the <style></style> tag with the <head> section.

<head>
(rest of the tags)
<style>
.none, .none table {mso-hide: all;}
</style>
</head>

 

Regarding your second query, What I'm confused by is where you got the class name ".none"?
It's from the meta tag with the name false_value="none"

 

<meta class="mktoBoolean" id="showheroButton" mktoname="Show Hero Button?" default="true" false_value="none" true_value="table-cell" false_value_name="NO" true_value_name="YES" />

 

Anonymous
Not applicable

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.

Sandeepkumar2
Level 2

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

Tags (1)
Olivia_Piper
Level 3

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

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.

Nicholas_Manojl
Level 9

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?

Oops, didn't pick up on this before. So... before I waste your time..

Yes, you need to have the variables sitting with a container/module for this to function, or exist within a <div class="mktEditable"> section.

Nicholas_Manojl
Level 9

Hey Olivia,

Have a look at this thread: Building emails using Foundation

You can ignore the Foundation bit, but it demonstrates how a variable is used and how it ultimately displays in the email editor.  You probably want to inline the CSS yourself.. I'm not sure that Marketo automatically inlines the CSS at send time and if it does, I don't think the Marketo inliner does a great job anyhow.

OR

<!--Inline CSS Example-->

<body>

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

That's clever but as Jim says, ultimately not necessarily. Usually you'd have your webinar section sitting as a module, which you can drag in and out of the editor. I can't necessarily think of a good example for using a boolean variable in the template. Maybe someone has a clever example.

That said, I guess your example should work, apart from the typo at the start of your meta tag, and once you create a container <div class="mktEditable">.

edit: the italic bit

Jim_Thao7
Level 9

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.

Nicholas_Manojl
Level 9

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

Jim_Thao7
Level 9

<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">