LogoLogo
HomepageDocumentationGet FeedOtter
  • Welcome to FeedOtter
  • Automated Newsletters
    • Getting Started
      • Marketo Sending
      • Pardot Sending
      • Eloqua Sending
      • SFMC Sending
      • HubSpot Sending
      • MailChimp Sending
      • Active Campaign Sending
    • Scheduling Your Send
      • Require New Content to Send
      • Intervals
    • Features
      • Last Send Date
      • Send Now
      • Sending History
      • UTM Parameters
      • Custom Subject Lines
      • Notifications
      • Multiple Feeds
        • Merging Feeds
        • Pulling in External JSON/XML Data
  • Curated Newsletters
    • Getting Started
      • Newsletter Defaults
      • Adding Content Sources
      • Create your first curated issue
      • Test, Review, and Publish your curated email newsletter
    • Publishing
      • Publishing to Marketo
        • Create a New Email Program and Email
        • Create a New Email in Marketo
        • Schedule an Email Program Send From the FeedOtter Interface
      • Publishing to Pardot
      • Publishing to Eloqua
        • Create a New Email and Schedule a Send
        • Create a New Email
        • Update an Existing Email
        • Issue Naming
      • Publishing to HubSpot
      • Publishing to MailChimp
      • Publishing to HTML
    • Tags
    • Bookmarking Content
    • Content Sources
      • Google Sheets
      • YouTube
      • Algolia
      • WordPress API
      • UberFlip
      • JSON / XML API
        • Custom Data Fields
    • Troubleshooting
      • Marketo Duplicate Object Naming
      • Marketo Emoji Support
      • MailChimp From Address
      • Pardot emails are missing a required Unsubscribe or Preference Center tag
  • Integrations
    • Getting Started
    • Marketo
      • How to Set Up Your Marketo Integration
      • FAQ
        • Email Reporting
        • Sending in Recipient Time Zone
        • Marketo Data Access
        • Custom Marketo Program Naming
        • Branded Domain and IP Settings
      • Troubleshooting
        • How do I reset my Marketo Automated Campaign
        • Marketo Error: Program with the same name exists
        • Marketo error: Daily quota '50000'
        • Marketo Error: Invalid request. Please check and try again.
        • Curated Issue Fails to Publish
          • FeedOtter Can Not Approve Marketo Template
          • Marketo rejects Duplicate Name
      • Exporting a FeedOtter email into Marketo
    • Pardot / Account Engagement
      • How to Set Up Your Pardot Integration
      • FAQ
        • Salesforce IP Whitelisting
        • Where Can I Find My Pardot Business Unit ID?
        • Pardot Data Access
        • Advanced Settings
          • Set Up a User for Integration
      • Troubleshooting
    • Eloqua
      • How to Set Up Your Eloqua Integration
      • FAQ
        • Custom Email and Campaign Naming
        • Custom Field Setup
        • Updating Eloqua Canvas Email
        • Eloqua Data Access
        • VMTA and BBE
    • Salesforce Marketing Cloud
      • How to Set Up Your SFMC Integration
      • FAQ
        • SFMC Tracking Code
        • SFMC Resources and Links
      • Troubleshooting
    • HubSpot
      • How to Set Up Your HubSpot Integration
      • FAQ
      • Manually publish an email to HubSpot
    • MailChimp
      • How to Set Up Your MailChimp Integration
    • ActiveCampaign
      • How to Set Up Your ActiveCampaign Integration
    • Microsoft Dynamics Marketing
      • How to Set Up Your MS Dynamics Integration
  • Email Templates
    • Getting Started
      • Custom Template
        • HTML Email Guidelines
          • In-Depth HTML Email Guidelines
        • Custom Template Resources
          • ESP Template Use
            • Export a Marketo Template for Use in FeedOtter
            • Export a Pardot Template for Use in FeedOtter
            • Export a HubSpot Template for Use in FeedOtter
            • Export an ActiveCampaign Template for Use in FeedOtter
        • Where to Access Template Code
        • Getting Started with FeedOtter Templates
          • Creating a Basic Email Template
          • Advanced Email Templates
            • Slicing loops
            • Multiple Feed Emails
            • Email With Columns
            • Conditionals
            • Filters
              • Image Resize Filter
              • Date Formatting Filter
              • Text Manipulation Filters
              • Other Handy Filters
            • Non-RSS XML values
            • Custom fields
            • Display a Full Article in Your Email
          • Curated Email Setup Best Practices
            • Curated Newsletter Sections
      • Element Customization
        • About Email Images
    • FeedOtter Tokens
    • ESP-Specific Tokens
      • Marketo Tokens
        • Using Marketo Tokens in the From and Reply-To
      • Pardot Tokens
        • Pardot Merge Token Reference
      • Eloqua Tokens
      • SFMC Tokens
      • HubSpot Tokens
      • MailChimp Tokens
      • ActiveCampaign Tokens
  • Account Management
    • Account Information
    • Company Details
    • Manage Users
      • Adding Users
      • User Roles
      • Campaign Permissions
      • Transfer Ownership
      • Disabling Users
    • Security
      • Enable SSO in Your Account
        • Enable SSO With Okta as the Identity Provider
        • Enable SSO with a Generic Identity Provider
        • Enable SSO with Azure AD as the Identity Provider
        • Enable SSO with OneLogin as the Identity Provider
      • Account Level 2FA
    • Billing
      • Update Your Payment Card
      • View Account Usage
      • View Receipts
      • Change Your Subscription Plan
  • FAQ
    • How to manually publish a curated newsletter
    • WordPress RSS Feed Reference
    • How to find your RSS feed
    • Help with HTML encoding
    • My automated email did not send as expected
    • How do I hard refresh my browser?
    • How to Remove "This Post First Appeared" from Your Blog's RSS Feed in WordPress
    • Whitelisting FeedOtter
    • Whitelist FeedOtter on CloudFlare
    • How do I contact support?
    • Red Dot: Campaign Status
      • Confirm your RSS Feed is valid
      • Confirm your integration is still connected
Powered by GitBook
On this page
  • Things to know
  • Following, you will find technical explanations, sample code, and details on how to create an HTML email template that displays data when used in the FeedOtter app.
  1. Email Templates
  2. Getting Started
  3. Custom Template

Getting Started with FeedOtter Templates

Last updated 4 months ago

When building custom email templates with FeedOtter’s template language, it’s essential to follow key guidelines. These best practices form the foundation for creating effective and functional templates.

In this article, you'll learn how to get started with FeedOtter's template language.

Things to know

  • FeedOtter uses a slightly modified version of the TWIG template syntax

Loops

Loops are the heart of every FeedOtter email. FeedOtter displays articles and content by looping through the number of articles you wish to show. In FeedOtter they look like this:

<!--## [% for post in feedotter.posts %] ##-->
... display content from an individual ITEM ...
<!--## [% endfor %] ##-->

To learn more about loops and how they are used read Anatomy of a FeedOtter Template.

Conditionals

You can show or hide portions of an email based on properties in the content using conditionals such as IF and IF/ELSE.

For a full list of conditionals and example code read .

Merge tokens

Merge tokens allow you to insert article data from RSS feeds and other content sources directly into your email.

  • Use campaign tokens to insert data related to the FeedOtter campaign, such as the date an automated email is sent or the name of the campaign in the <title> tag of an email.

  • Use post loop tokens INSIDE the LOOP of your FeedOtter email. These tokens will insert data from your source, like post title, description, featured image, URL, etc.

  • Use UI tokens to interact with the FeedOtter "edit" UI. Examples include primary color and button color. When coding your own template, we recommend hard-coding your colors and skipping these tokens.

  • Use custom tokens to make parts of your email editable from the FeedOtter interface. Customers can use these tokens for custom image uploads, text and headline updates, and more. Campaigns are limited to 10 custom tokens per template.

External ESP Tokens

You may also use ESP tokens in your FeedOtter emails. Unsubscribe and View as Webpage are common examples. These ESP tokens are supported in the following areas:

  • HTML template code

  • Subject lines

  • Custom fields

Following, you will find technical explanations, sample code, and details on how to create an HTML email template that displays data when used in the FeedOtter app.

Example 1:

Like other email software, FeedOtter performs best with a well-designed and thoroughly tested HTML email template. Once your template has been created, coded, and tested with a compatibility tool like Litmus, you can then add the necessary FeedOtter code.

The heart and soul of a FeedOtter template is a FOR loop that will wrap block(s) of HTML where you wish your RSS/article content to display.

Here is an example of a FeedOtter HTML email using a FOR loop and displaying the Title and an anchor link to the article webpage.

<html>
<body>

<!--## [% for post in feedotter.posts %] ##-->
<table width="100%" style="border-bottom:2px dotted #ccc">
    <tr width="100%">
        <td width="100%">
            <h1>[[post.post_title]]</h1>            
            <a href="[[post.post_url]]" target="blank">Read More</a>            
        </td>
    </tr>
</table>
<!--## [% endfor %] ##-->

</body>
</html>

Line 4 - This is the opening of the FOR loop. This tells FeedOtter where to start to loop over article content.

Lines 5 through 12 - This is HTML that will be repeated for each article present in a FeedOtter automation.

Line 13 - This is the ENDFOR. This tells FeedOtter where the end of the loop is. All HTML between the FOR loop and ENDFOR line will be duplicated.

(optional) Special Comment Wrappers

// FeedOtter FOR loops and IF statements typically have a special comment wrapper:
<!--## ... ##-->
// These are optional but they are a best-practice and will make working with an email in tools like Dreamweaver better.

The number of loop passes is determined by the Max Posts setting in the FeedOtter UI.

Example 2:

Here is another example of a FeedOtter HTML template this time we will examine it backwards by looking at the styled email displaying multiple articles.

Let's break this design down:

Logo - This is hard-coded with the image hosted in your email software or website.

"3 Useful Ways..." article - The "loop" block. This is where the loop exists.

"A/B Subject Line..." article + 3 more posts - Automatically created by the FeedOtter loop

Footer - Hard-coded into the HTML template. The footer should also include an Unsubscribe or preference center links specific to your email software.

Taking a closer look at the looping area of the HTML to see what a more "styled" template really looks like. Anything that looks like [[ something ]] is a FeedOtter token and either inserts data from the RSS feed or inserts a value editable in the FeedOtter application UI.

<!--## [% for post in feedotter.posts %] ##-->
        <tr>
          <td valign="top" align="center"><table width="650" border="0" cellspacing="0" cellpadding="0" align="center" style="width: 650px;" class="em_wrapper">
              <tbody>
                <tr>
                  <td width="25" style="width: 25px;" class="em_side15">&nbsp;</td>
                  <td valign="top" align="center" style="padding-bottom: 50px;" class="em_pbottom30"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
                      <tbody>
                        <tr>
                          <td valign="top" align="left" style="font-family: Helvetica, Arial, sans-serif; color: [[feedotter.primary_color]]; font-size: 13px; line-height: 16px; font-weight: 700; padding-bottom: 12px;" class="em_defaultlink">[[post.post_author]]</td>
                        </tr>
                        <tr>
                          <td valign="top" align="left" style="" class="em_defaultlink">
                          <a href="" target="_blank" style="text-decoration-line: none; font-family: Helvetica, Arial, sans-serif; color: [[feedotter.button_color]]; font-size: 18px; line-height: 21px; font-weight: 700; padding-bottom: 10px;">
                          </a></td>
                        </tr>
                        <tr>
                          <td valign="top" align="left" style="font-family: Helvetica, Arial, sans-serif; color: [[feedotter.primary_color]]; font-size: 15px; line-height: 21px; font-weight: 400; padding-bottom: 10px;" class="em_defaultlink">[[post.post_excerpt_text | truncate(feedotter.post_body_char_limit,true,"...")]]</td>
                        </tr>
                        <tr>
                          <td valign="middle" align="left" style="font-family: Helvetica, Arial, sans-serif; color: [[feedotter.button_color]]; font-size: 12px; line-height: 15px; font-weight: 700;" class="em_defaultlinku"><a href="[[post.post_url]]" target="_blank" style="text-decoration: underline; color: [[feedotter.button_color]];">[[post.cta_text]]</a></td>
                        </tr>
                      </tbody>
                    </table></td>
                  <td width="25" style="width: 25px;" class="em_side15">&nbsp;</td>
                </tr>
              </tbody>
            </table></td>
        </tr>
<!--## [% endfor %] ##-->

Now, it would be helpful to learn how to create a basic email template using this information:

See the full list of FeedOtter tokens .

Conditionals
here
Creating a Basic Email Template
FeedOtter template example to show FO token language