Blog

Guide to Marketo Email Syntax and Template Design

  • Nick Donaldson

    Nick Donaldson

    Director of Growth Marketing, Knak

Published May 10, 2024

Guide to Marketo Email Syntax and Template Design

Setting up email templates in Marketo is one of the most important ways to scale your marketing and campaign operations. Well-designed templates give your marketing team the ability to launch go-to-market campaigns on a moment's notice, a competitive advantage every team wants.

Developing and designing email templates in Marketo requires expertise in HTML and CSS. Additionally, you need to understand the basics of Marketo Syntax. Marketo Syntax is a core feature of email template design, and enables end-users to modify templates to send emails. It also enables advanced functionality that can help boost efficiency and scale your operations.

This blog post is a deep dive into Marketo syntax and how you can leverage it to create templates.

What is Marketo Syntax?

What is Marketo Syntax?

Marketo syntax is a specific set of custom HTML attributes and classes used within Marketo's email and landing page templates to define editable regions and enable dynamic content. The syntax is applied to the template by a developer or an email building tool, and is required to create valid templates in Marketo.

For example, a typical newsletter email may include HTML elements like this at the top of the body:

<div>

<h1>Welcome to Our Newsletter</h1>

<p>Hello, thank you for subscribing to our monthly newsletter. Here's what's new!</p>

<img src="http://example.com/image.jpg" alt="Featured Image">

</div>

With Marketo syntax, you'd add attributes to allow end users to a) reuse this template for each monthly newsletter, and b) modify the template in the Marketo email editor. Here's how the same section may look with Marketo syntax:

<div>

<h1 class="mktoText" id="headerText" mktoName="Header Text">Welcome to Our Newsletter</h1>

<p class="mktoText" id="introText" mktoName="Introduction Text">Hello, thank you for subscribing to our monthly newsletter. Here's what's new!</p>

</div>

In the example with Marketo syntax, we're doing two things:

  1. Enabling the region to be editable by adding the class "mktoText" to the h1 element
  2. Using attributes like id and mktoName to identify unique elements in the template to make them easy for users to understand what each editable field represents

A valid Marketo email template has two requirements:

  1. Valid HTML
  2. At least one editable region

Understanding Marketo syntax is essential for creating Marketo email templates.

Overview of Marketo Syntax Elements

Before we do a deep dive on individual syntactic elements, let's do a quick overview of the available elements.

Element Type

Rich Text

Required Attributes

class: "mktEditable" or "mktoText", id

Optional Attributes

mktoName (display name)

Description

Allows editing of content via Marketo’s Rich Text Editor. Supports backward compatibility with class "mktEditable". "mktoText" provides a standardized display name.

Element Type

Images

Required Attributes

class: "mktoImg", id

Optional Attributes

mktoName, mktoImgClass, mktoImgSrc, mktoImgLink, mktoImgLinkTarget, mktoImgWidth, mktoImgHeight, mktoLockImgSize, mktoLockImgStyle

Description

Defines editable image areas within emails. Can be configured as a div for complex setups (with links) or a simple img tag.

Element Type

Snippets

Required Attributes

class: "mktoSnippet", id

Optional Attributes

mktoName, mktoDefaultSnippetId (default snippet to display)

Description

Configures a specific area in the email where users can insert pre-approved content snippets.

Element Type

Videos

Required Attributes

class: "mktoVideo", id

Optional Attributes

mktoName, mktoImgClass (class for video thumbnail)

Description

Allows embedding of YouTube or Vimeo videos as thumbnails within the email, which users can interact with.

Element Type

Variables

Required Attributes

meta tag with class (e.g., "mktoString"), id, mktoName

Optional Attributes

allowHTML (for String), values (for List), min/max/units/step (for Number), default (initial value for any type), mktoModuleScope (local/global scope)

Description

Defines reusable content or settings such as text strings, lists, numbers, colors, and Booleans that users can edit or toggle within the email editor.

Element Type

Modules

Required Attributes

class: "mktoModule", id, mktoName

Optional Attributes

mktoActive (visibility in editor), mktoAddByDefault (auto inclusion in new emails)

Description

Designated reusable blocks that can be inserted into emails. Controlled by the template for consistency and responsiveness.

Element Type

Containers

Required Attributes

class: "mktoContainer", id

Optional Attributes

None explicitly mentioned

Description

Organizational elements that hold modules and dictate their placement within the email layout, ensuring modular and flexible design structures.

Rich Text

Rich text elements in Marketo allow for content editing directly through Marketo's Rich Text Editor. By applying the "mktoText" class to an element, marketing users can update the property inserting elements as needed such as headings, bullet lists, and body content. Marketo still supports the "mktEditable" class but it's important to note that "mktoText" is the preferred class now.

Code Example

<div class="mktoText" id="mainContent" mktoName="Main Content">

Welcome to our newsletter! Here’s the latest news.

</div>

Images

Developers can enable the editing of images using the "mktoImg" class. This class can be applied directly to an <img> element or to the surrounding <div> tag. Each option gives marketing users different choices for editing. In the case of applying it to an <img> element, it is more strict and only allows for image replacement. For the <div> element, the marketing user has more flexibility, for example, adding a hyperlink to the image.

Code Example

<div class="mktoImg" id="featureImage" mktoName="Feature Image" mktoImgLink="https://example.com" mktoImgLinkTarget="_blank">

<img src="http://example.com/default-image.jpg" alt="Featured">

</div>

Snippets

Snippets are predefined, reusable content blocks that you can use to insert content into your emails. Common use cases of snippets are headers, footers, and email preference management links. To specify which snippet to use, make sure to update the "mktoDefaultSnippetId" attribute with the numerical ID of the approved snippet. This will automatically add the snippet to your email content for you.

Code Example

<div class="mktoSnippet" id="promoSnippet" mktoName="Promotional Snippet" mktoDefaultSnippetId="101">

<!-- Snippet content will be dynamically inserted here -->

</div>

Videos

The video element allows you to embed video content from a YouTube or Vimeo URL. The content will be displayed as a thumbnail with a play button visible. Remember support for video in email is spotty among email clients. It may be useful to advise marketing users to add alternative text to video thumbnails to improve accessibility.

Code Example

<div class="mktoVideo" id="videoBlock" mktoName="Product Video">

<img src="http://example.com/video-thumbnail.jpg" alt="Watch our product video">

</div>

Variables

Marketo variables can be defined at either the global level or local level. At the global level, variables are defined in the <head> of the email template and apply to all modules within the template. Local variables are scoped to modules in which they are defined and each instance of a module can have its own local variable. For example, you may define your brand name as a global variable but then have different promotion headers in different modules.

Code Example

<meta class="mktoString" id="campaignName" mktoName="Campaign Name" default="Spring Sale">

<!-- Usage within the email -->

${campaignName}

Modules

Modules are predefined components within an email template that can be configured and inserted by users. Think of modules as building blocks in email design – they allow users to create fully designed emails from reusable components such as a header, banner image, body content, and footer. Modular design is a key trend in email marketing as it speeds up the design process, can ensure responsiveness and client-compatibility regardless of the email, and can be designed ahead of time.

Code Example

<tr class="mktoModule" id="headerModule" mktoName="Header Module">

<td>

<!-- Content here can be modified or replaced in the email editor -->

Header content goes here.

</td>

</tr>

Containers

Containers are the structural framework of Marketo templates. They hold modules and define where they are allowed to be placed. Templates can only contain modules (see above) and you can have only one container per template.

Code Example

<table class="mktoContainer" id="mainContainer">

<tr>

<td>

<!-- Modules are inserted within this container -->

</td>

</tr>

</table>

Integrating Marketo Syntax for Advanced Customization

Integrating Marketo Syntax for Advanced Customization

Marketo syntax enables advanced customization of your email templates to allow you to develop templates that meet the campaign needs of your marketing team. At the most basic level, you could create emails with a single editable region and provide your team with a fixed, simplistic template. This approach guarantees that you'll be inundated with requests to modify the template to include CTA buttons, images, add content columns for newsletters, and so on.

Marketo syntax is the key to scaling your email templates and making them useful to your entire team. It takes time to develop templates that fit all your needs. It may be tempting to use modules to create a "master" template that contains all possible regions and email design patterns your marketing team may need. This approach, too, falls apart pretty quickly.

The answer is to create templates for common use cases such as webinars, newsletters, and content download emails, while giving flexibility within each template to add or remove modules. Flexibility is required but too much choice provides lots of room to create Frankenstein-emails that are assembled from many different parts. For more structured learning, explore Marketo courses.

Email development is its own specific branch of web development – despite using technologies like HTML and CSS, it can require a unique, even alien approach. Marketo syntax is a powerful addition to your toolkit but it requires some skill and studying the Marketo documentation.

Using No-Code Tools for Marketo Email Templates

Not everyone is a developer, not every marketing organization has access to developers, and not every developer knows email design.

No-code tools like Knak are the answer – even if you have all those resources available to you. Marketo syntax is a powerful tool but it's complex and requires skill to use effectively. No-code tools take care of this piece by providing a user interface that deftly navigates the intricacies of email design.

It's more than just making the development of email templates easy; it's about democratizing the marketing process itself. The compartmentalization of design, development, and content in the email marketing process creates inefficiencies and barriers to exercising creative freedom. This takes the form of design but also the speed with which teams can bring ideas to life.

Time is often of the essence in marketing, and missing an opportunity because your developer is neck-deep in Marketo syntax docs isn't a great look.

No-code tools also allow for integration with Marketo. Create and design emails in Knak, for instance, and sync them directly to your Marketo instance. You can also make use of features like collaboration and project management to follow your marketing operation process to ensure every email is on brand.

This is one area of your marketing technology stack that you can future-proof! You can watch a demo of Knak here and see our no-code email template tool in action.


Share this article

  • Nick-Donaldson headshot 2024

    Author

    Nick Donaldson

    Director of Growth Marketing, Knak

Why marketing teams love Knak

  • 95%better, faster campaigns = more success

  • 22 minutesto create an email*

  • 5x lessthan the cost of a developer

  • 50x lessthan the cost of an agency**

* On average, for enterprise customers

** Knak base price

Ready to see Knak in action?

Get a demo and discover how visionary marketers use Knak to speed up their campaign creation.

Watch a Demo
green sphere graphic used for decorative accents - Knak.com