Sendwithus supports a rich templating language, built on top of Jinja2. Mandrill users should find migrating a straightforward process with a few pleasant surprises regarding additional functionality.

Terminology Differences

Most terminology is similar, but here’s the base list:

Mandrill Speak Sendwithus Lingo Bonus
Merge Vars Dynamic Content Sendwithus supports merging full JSON objects into templates, see Dynamic Content
Senders/Ips ESP Accounts Sendwithus abstracts the delivery engine by integrating with many popular ESP's and providing a Send API that lets you specify the ESP at send time
Webhooks Webhooks Sendwithus supports, which are easy to setup

Templating Variances

The basic examples of templating are the same, but there are differences for more advanced template functions (like looping or conditionals).

Templating Goal Mandrill Templates Sendwithus
Variables {{ variable_name }} {{ variable_name }}
Nested Variables {{ person.name }} {{ person.name }}
For Loop {{#each list}}...{{this}}...{{/each}} {% for item in list %}{{ item.nested }}{% endif %}
If Statement {{# if conditional }}...{{/if }} {% if conditional %}...{% endif %}

We have a handy in-depth email templating guide about the nuances of creating emails in sendwithus.

Email History and View Sent Email

Every time you send an email to a customer with Sendwithus, the email is tracked to that customers profile. You can search by email address on the Customers page to find and view their profile.

Additionally, Sendwithus stores a copy of the exact HTML sent to each customer – include dynamic content. Using this you can troubleshoot any email issues a customer brings up or debug a new email you’re sending.

Major Differences from Mandrill

Snippets (Template Includes)

Snippets are Sendwithus’ way for you to build repeatable blocks that you include in any of your templates. Common use cases are a standard header/footer for everyone of your templates; updating the snippets instantly updates all templates that use it!

Another common use case is to generate complex buttons (dynamically include campaing tracking codes, for example). Snippets can do this because they can include dynamic content and can be called recursively.

For more information on snippets head on over to the snippets documentation.

Advanced Filters

Jinja allows for several advanced filters in your templates. Common examples are formatting dates in your emails (either to a readable date like “January 1”, or to localize dates).

Other common filters allow for formatting currencies to different locales or styling tables. You can learn about formatting numbers or formatting dates in our docs.

Previewing Templates with Data and Device Testing

The Sendwithus editor has built in support for previewing a template with data, as well as Device Testing.

Macro Support

Finally, Sendwithus templating allows you to write custom Macros. Macros are mini functions that can run inside your template or Snippets.

Common use cases for macros is generating a dynamic menu inside an email, or building a product listing block for multiple emails.

More information on macros can be found in the Jinja2 macro documentation.