Email infrastructure service offered as an add-on for MailChimp,
Used to send personalized, one-to-one e-commerce emails, or automated transactional emails.
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
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}}
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|*
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.
}
]