SlideShare a Scribd company logo
Mandrill Templates
Bharat Singh
Software Consultant
Knoldus Software LLP.
Agenda
● Mandrill
● Dynamic Templating
● Handlebars
● Merge Vars
● Merge Tags & MCTL
● Editable Content
● Demo
Mandrill
Quick Overview : What ?
● Email infrastructure service offered as an add-
on for MailChimp
● Used to send personalized, one-to-one e-
commerce emails, or automated transactional
emails.
Mandrill
Transactional Emails: Why ?
● Also referred to as app-based email, it is the
little mail you receive after performing a certain
action, or an action is taken for you
● Your own STMP server v/s Mandrill
Mandrill
Transactional Emails: Why ?
● Also referred to as app-based email, it is the
little mail you receive after performing a certain
action, or an action is taken for you
● Your own STMP server v/s Mandrill
Mandrill
Integration: How ?
● SMTP : Traditional way [limited]
● API : Extended options and Reporting
Dynamic Templating
● Create email design & store frequently-used content to reuse.
● Send email using the template & provide only dynamic
recipient-specific content.
Advantages :
● Efficiency : API calls are lightweight [only dynamic data].
● Useability : Non-developers can edit template design.
Via : MailChimp, API, Mandrill Console
Dynamic Templating
Handlebars
● A handlebars expression is
{{ some contents }}.
● Handlebars templates are basically made up of data, paths
and helpers
Data
● All the static content of the template is your data, which does
not get included in handlebars or helpers, ex: Html tags
Dynamic Templating
Path
All the dynamic content sent to the Mandrill is accessed by a
specific path. It includes the name of the Merged Var followed by
a ‘.’ operator and then the name of the key or element.
Merged Vars
● global_merge_vars : To provide a global variable value
"global_merge_vars": [{
"name": "CompanyName",
"content": "Knoldus Software LLP"
}]
Dynamic Templating
Merged Vars
● merge_vars : To provide a recipient specific variable value
"merge_vars": [{
“rcpt” : “bharat@knoldus.com”,
“vars”: [
{
"name": "Name",
"content": "Bharat"
}
]
}]
Dynamic Templating
Helpers
● Inline helpers are used as: {{helperName arg1 arg2 arg3}}
● Block helpers are used as:
{{#helperName arg 1 arg2}}
other stuff
{{else}}
else block - helper specific if it's supported and how it
works
{{/helperName}}
Dynamic Templating
Dynamic Templating
Dynamic Templating
Block Helpers
● The if helper : When using the {{#if}} helper in Handlebars, any
expression whose value is not false, undefined, null, "", 0, or []
will evaluate as true.
● The unless helper : The content inside the block will be
displayed when the expression is evaluated to false, or unless it's
true. It's equivalent to if not
Dynamic Templating
Block Helpers
● The if-elseif-else helper :
{{#if `operating_system == "OS X"`}}
<p>Click here for instructions to install on a Mac</p>
{{elseif `operating_system == "Windows"`}}
<p>Click here for instructions to install on a PC</p>
{{/if}}
Dynamic Templating
Block Helpers
● The each helper :
<div class="entry">
<ul>
<li style="list-style: none">{{#each browsers}}</li>
<li>{{this}}</li>
<li style="list-style: none">{{/each}}</li>
</ul>
</div>
Dynamic Templating
● Merge Tags
● Introduced initially by MailChimp, Mandrill supports these to
help Mailchimp users to port templates.
● Format : *|MERGETAG|*
Dynamic Templating
● Merge Tags
● Conditional Merge Tags :
*|IF:MERGE=x|*
<p>content to display if the value for MERGE is x</p>
*|ELSEIF:MERGE=y|*
<p>content to display if the value for MERGE is not x, but
is y</p>
*|ELSE:|*
<p>alternate content to display</p>
*|END:IF|*
Dynamic Templating
● Merge Tags
● Encoding Merge Tags :
● *|HTML:YOUR_MERGETAG|*
● *|URL:YOUR_MERGETAG|*
● *|TITLE:YOUR_MERGETAG|*
● *|LOWER:YOUR_MERGETAG|*
● *|UPPER:YOUR_MERGETAG|*
Dynamic Templating
● Editable Content
● Its the part of MailChimp template language
● Used to create regions that can be completely replaced with
contents
<div mc:edit="header">
<h2>Thank you for your purchase</h2>
</div>
<div mc:edit="main" >
We appreciate your business
</div>
<div mc:edit="footer">
Company contact information will go here.
</div>
Dynamic Templating
● Editable Content
● "template_content": [
{
"name": "header",
"content": "<h2>Your Order is Complete</h2>"
},
{
"name": "main",
"content": "We appreciate your business.
}
]
Questions ?
References
● https://mandrill.zendesk.com/hc/en-us/sections/200775387-
Templates-and-Dynamic-Content
● https://www.sitepoint.com/need-transactional-email/
● http://blog.mandrill.com/handlebars-for-templates-and-dynamic-
content.html
Thank You

More Related Content

PDF
How we scaled git lab for a 30k employee company
PDF
Introduction to CSS
PPT
Intro to html
PDF
Basic Html Notes
PPTX
(Fast) Introduction to HTML & CSS
PPTX
11. pelepasan
PPTX
TATA IBADAH MINGGU SENGSARA KE-VI. Minggu, 26 Maret 2023..pptx
ODP
HTML5, CSS, JavaScript Style guide and coding conventions
How we scaled git lab for a 30k employee company
Introduction to CSS
Intro to html
Basic Html Notes
(Fast) Introduction to HTML & CSS
11. pelepasan
TATA IBADAH MINGGU SENGSARA KE-VI. Minggu, 26 Maret 2023..pptx
HTML5, CSS, JavaScript Style guide and coding conventions

Viewers also liked (20)

ODP
Functional programming in Javascript
ODP
Introduction to BDD
PDF
Fast dataarchitecture
ODP
MongoDB: Advance concepts - Replication and Sharding
ODP
Deep dive into sass
ODP
Lambda Architecture with Spark
ODP
Cassandra - Tips And Techniques
ODP
Akka Finite State Machine
ODP
Introduction to AWS IAM
PPTX
Petex 2016 Future Working Zone
PDF
How the web was won
ODP
Introduction to Scala JS
ODP
Akka streams
ODP
Getting Started With AureliaJs
ODP
Drilling the Async Library
ODP
Realm Mobile Database - An Introduction
ODP
String interpolation
ODP
Mailchimp and Mandrill - The ‘Hominidae’ kingdom
ODP
Shapeless- Generic programming for Scala
PDF
Kanban
Functional programming in Javascript
Introduction to BDD
Fast dataarchitecture
MongoDB: Advance concepts - Replication and Sharding
Deep dive into sass
Lambda Architecture with Spark
Cassandra - Tips And Techniques
Akka Finite State Machine
Introduction to AWS IAM
Petex 2016 Future Working Zone
How the web was won
Introduction to Scala JS
Akka streams
Getting Started With AureliaJs
Drilling the Async Library
Realm Mobile Database - An Introduction
String interpolation
Mailchimp and Mandrill - The ‘Hominidae’ kingdom
Shapeless- Generic programming for Scala
Kanban
Ad

Similar to Mandrill Templates (20)

PPTX
Build, train and deploy your ML models with Amazon Sage Maker
PPTX
Informatica Online Training
PDF
Hortonworks Technical Workshop: Apache Ambari
PPTX
Internals of internal
PDF
Hadoop France meetup Feb2016 : recommendations with spark
PDF
Serverless APIs with JavaScript - Matt Searle - ChocPanda
PDF
Ecommerce as an Engine
PPTX
Final Java-script.pptx
PPTX
Threshold Billing Script Without Video
PPTX
Boosting Personalization In SaaS Using Machine Learning
PDF
Deep Visibility: Logging From Distributed Microservices
PDF
Headless Magento - Meet Magento Poland 2017
PDF
Boosting Personalization In SaaS Using Machine Learning.pdf
PDF
CloudWatch hidden features for debugging serverless application
PDF
Carlo Bonamico, Sonia Pini - So you want to build your (Angular) Component Li...
PDF
Build Your Own Angular Component Library
PPTX
Grails Services
PDF
Yarmouk Google Developers Group Devfest
PPTX
Azure integration in dynamic crm
PPTX
Simplified Cluster Operation and Troubleshooting
Build, train and deploy your ML models with Amazon Sage Maker
Informatica Online Training
Hortonworks Technical Workshop: Apache Ambari
Internals of internal
Hadoop France meetup Feb2016 : recommendations with spark
Serverless APIs with JavaScript - Matt Searle - ChocPanda
Ecommerce as an Engine
Final Java-script.pptx
Threshold Billing Script Without Video
Boosting Personalization In SaaS Using Machine Learning
Deep Visibility: Logging From Distributed Microservices
Headless Magento - Meet Magento Poland 2017
Boosting Personalization In SaaS Using Machine Learning.pdf
CloudWatch hidden features for debugging serverless application
Carlo Bonamico, Sonia Pini - So you want to build your (Angular) Component Li...
Build Your Own Angular Component Library
Grails Services
Yarmouk Google Developers Group Devfest
Azure integration in dynamic crm
Simplified Cluster Operation and Troubleshooting
Ad

More from Knoldus Inc. (20)

PPTX
Angular Hydration Presentation (FrontEnd)
PPTX
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
PPTX
Self-Healing Test Automation Framework - Healenium
PPTX
Kanban Metrics Presentation (Project Management)
PPTX
Java 17 features and implementation.pptx
PPTX
Chaos Mesh Introducing Chaos in Kubernetes
PPTX
GraalVM - A Step Ahead of JVM Presentation
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
DAPR - Distributed Application Runtime Presentation
PPTX
Introduction to Azure Virtual WAN Presentation
PPTX
Introduction to Argo Rollouts Presentation
PPTX
Intro to Azure Container App Presentation
PPTX
Insights Unveiled Test Reporting and Observability Excellence
PPTX
Introduction to Splunk Presentation (DevOps)
PPTX
Code Camp - Data Profiling and Quality Analysis Framework
PPTX
AWS: Messaging Services in AWS Presentation
PPTX
Amazon Cognito: A Primer on Authentication and Authorization
PPTX
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
PPTX
Managing State & HTTP Requests In Ionic.
Angular Hydration Presentation (FrontEnd)
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Self-Healing Test Automation Framework - Healenium
Kanban Metrics Presentation (Project Management)
Java 17 features and implementation.pptx
Chaos Mesh Introducing Chaos in Kubernetes
GraalVM - A Step Ahead of JVM Presentation
Nomad by HashiCorp Presentation (DevOps)
Nomad by HashiCorp Presentation (DevOps)
DAPR - Distributed Application Runtime Presentation
Introduction to Azure Virtual WAN Presentation
Introduction to Argo Rollouts Presentation
Intro to Azure Container App Presentation
Insights Unveiled Test Reporting and Observability Excellence
Introduction to Splunk Presentation (DevOps)
Code Camp - Data Profiling and Quality Analysis Framework
AWS: Messaging Services in AWS Presentation
Amazon Cognito: A Primer on Authentication and Authorization
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Managing State & HTTP Requests In Ionic.

Recently uploaded (20)

PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Understanding Forklifts - TECH EHS Solution
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPT
Introduction Database Management System for Course Database
PPTX
L1 - Introduction to python Backend.pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Online Work Permit System for Fast Permit Processing
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Transform Your Business with a Software ERP System
PPTX
ai tools demonstartion for schools and inter college
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
history of c programming in notes for students .pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
System and Network Administration Chapter 2
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Operating system designcfffgfgggggggvggggggggg
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Understanding Forklifts - TECH EHS Solution
How Creative Agencies Leverage Project Management Software.pdf
Introduction Database Management System for Course Database
L1 - Introduction to python Backend.pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
Online Work Permit System for Fast Permit Processing
How to Migrate SBCGlobal Email to Yahoo Easily
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Transform Your Business with a Software ERP System
ai tools demonstartion for schools and inter college
CHAPTER 2 - PM Management and IT Context
history of c programming in notes for students .pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
System and Network Administration Chapter 2
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Operating system designcfffgfgggggggvggggggggg

Mandrill Templates

  • 1. Mandrill Templates Bharat Singh Software Consultant Knoldus Software LLP.
  • 2. Agenda ● Mandrill ● Dynamic Templating ● Handlebars ● Merge Vars ● Merge Tags & MCTL ● Editable Content ● Demo
  • 3. Mandrill Quick Overview : What ? ● Email infrastructure service offered as an add- on for MailChimp ● Used to send personalized, one-to-one e- commerce emails, or automated transactional emails.
  • 4. Mandrill Transactional Emails: Why ? ● Also referred to as app-based email, it is the little mail you receive after performing a certain action, or an action is taken for you ● Your own STMP server v/s Mandrill
  • 5. Mandrill Transactional Emails: Why ? ● Also referred to as app-based email, it is the little mail you receive after performing a certain action, or an action is taken for you ● Your own STMP server v/s Mandrill
  • 6. Mandrill Integration: How ? ● SMTP : Traditional way [limited] ● API : Extended options and Reporting
  • 7. Dynamic Templating ● Create email design & store frequently-used content to reuse. ● Send email using the template & provide only dynamic recipient-specific content. Advantages : ● Efficiency : API calls are lightweight [only dynamic data]. ● Useability : Non-developers can edit template design. Via : MailChimp, API, Mandrill Console
  • 8. Dynamic Templating Handlebars ● A handlebars expression is {{ some contents }}. ● Handlebars templates are basically made up of data, paths and helpers Data ● All the static content of the template is your data, which does not get included in handlebars or helpers, ex: Html tags
  • 9. Dynamic Templating Path All the dynamic content sent to the Mandrill is accessed by a specific path. It includes the name of the Merged Var followed by a ‘.’ operator and then the name of the key or element. Merged Vars ● global_merge_vars : To provide a global variable value "global_merge_vars": [{ "name": "CompanyName", "content": "Knoldus Software LLP" }]
  • 10. Dynamic Templating Merged Vars ● merge_vars : To provide a recipient specific variable value "merge_vars": [{ “rcpt” : “bharat@knoldus.com”, “vars”: [ { "name": "Name", "content": "Bharat" } ] }]
  • 11. Dynamic Templating Helpers ● Inline helpers are used as: {{helperName arg1 arg2 arg3}} ● Block helpers are used as: {{#helperName arg 1 arg2}} other stuff {{else}} else block - helper specific if it's supported and how it works {{/helperName}}
  • 14. Dynamic Templating Block Helpers ● The if helper : When using the {{#if}} helper in Handlebars, any expression whose value is not false, undefined, null, "", 0, or [] will evaluate as true. ● The unless helper : The content inside the block will be displayed when the expression is evaluated to false, or unless it's true. It's equivalent to if not
  • 15. Dynamic Templating Block Helpers ● The if-elseif-else helper : {{#if `operating_system == "OS X"`}} <p>Click here for instructions to install on a Mac</p> {{elseif `operating_system == "Windows"`}} <p>Click here for instructions to install on a PC</p> {{/if}}
  • 16. Dynamic Templating Block Helpers ● The each helper : <div class="entry"> <ul> <li style="list-style: none">{{#each browsers}}</li> <li>{{this}}</li> <li style="list-style: none">{{/each}}</li> </ul> </div>
  • 17. Dynamic Templating ● Merge Tags ● Introduced initially by MailChimp, Mandrill supports these to help Mailchimp users to port templates. ● Format : *|MERGETAG|*
  • 18. Dynamic Templating ● Merge Tags ● Conditional Merge Tags : *|IF:MERGE=x|* <p>content to display if the value for MERGE is x</p> *|ELSEIF:MERGE=y|* <p>content to display if the value for MERGE is not x, but is y</p> *|ELSE:|* <p>alternate content to display</p> *|END:IF|*
  • 19. Dynamic Templating ● Merge Tags ● Encoding Merge Tags : ● *|HTML:YOUR_MERGETAG|* ● *|URL:YOUR_MERGETAG|* ● *|TITLE:YOUR_MERGETAG|* ● *|LOWER:YOUR_MERGETAG|* ● *|UPPER:YOUR_MERGETAG|*
  • 20. Dynamic Templating ● Editable Content ● Its the part of MailChimp template language ● Used to create regions that can be completely replaced with contents <div mc:edit="header"> <h2>Thank you for your purchase</h2> </div> <div mc:edit="main" > We appreciate your business </div> <div mc:edit="footer"> Company contact information will go here. </div>
  • 21. Dynamic Templating ● Editable Content ● "template_content": [ { "name": "header", "content": "<h2>Your Order is Complete</h2>" }, { "name": "main", "content": "We appreciate your business. } ]