SOLVED

Email Guided Template Syntax

Go to solution
Olivia_Piper
Level 3

Email Guided Template Syntax

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

Accepted Solutions
Olivia_Piper
Level 3

Re: Email Guided Template Syntax

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
Jim_Thao7
Level 9

Re: Email Guided Template Syntax

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

Re: Email Guided Template Syntax

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

Re: Email Guided Template Syntax

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 9

Re: Email Guided Template Syntax

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

Re: Email Guided Template Syntax

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

Nicholas_Manojl
Level 9

Re: Email Guided Template Syntax

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.

Olivia_Piper
Level 3

Re: Email Guided Template Syntax

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

Re: Email Guided Template Syntax

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

Anonymous
Not applicable

Re: Email Guided Template Syntax

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.