1
Isaac Kim & Fiona Snoddy
Advanced Templatization
November 3, 2015
2
Fiona Snoddy
•  Celebrating 1-year anniversary with SparkPost
•  Worked on several SPE implementations, including our very first!
•  Lives in Columbia, MD
•  Loves working-out, water-skiing and watching rugby & ice-hockey
3
Let’s Go Caps!!!!
4
Isaac Kim
•  Been with SparkPost for 8 months
•  Supports both SPE and Momentum implementations
•  Lives in Columbia, MD
•  Loves fishing, CrossFit, and recently started up archery
5
Chris Arnold - Template Guru
6
Objectives
Exposure to
Advanced Template
Functionality
Insight into
Real-world
Applications
Knowledge of
Resources
7
Agenda
•  Templating Overview
•  Conditional Statements
•  Personalized Links
­  URL encoding
­  Disabling URL encoding
•  Dynamic Content
•  Looping
­  Simple
­  Nested
•  Q & A
8
Approach: The Bears are Heading to Insight
9
Transmission Substitution Data
Conditional IF not Statement
Triple Curly Escape URL Link
Conditional IF Statement
Encoded URL Link
Complex Conditional
Statement
Dynamic Content
Simple Loop
Simple Loop with
Multiple Objects
Nested Loop with Objects
10
Template features accessible on…
SparkPost
SparkPost
Elite
Momentum
Template Functionality
11
Templating Overview
•  Substitution data can be specified at the transmission and/or
recipient level
•  Defined as a JSON object of key/value pairs
•  Substitute using double curly brackets
•  Substitution data can be used in both text and HMTL templates
•  Metadata can be also be used as substitution data
JSON substitution data can be combined with a template to
personalize the recipient’s text, HTML and subject line
12
Template:
Templating Overview: Real-world Application
{
"firstName” : "Papa Bear”
}
Substitution Data:
Welcome to Insight {{firstName}}!
13
Conditional Statements
•  Can be used standalone as well as in expressions
•  Multiple syntax options
­  If then else
­  If not
­  Elseif
­  If empty
­  If not empty
•  Can be complex
­  combine with basic/robust substitutions
­  Concatenated conditions i.e. if A and B and C = x then
The ability to render different per recipient content
based on a given condition(s)
14
Conditional Statements: Syntax Examples
The conditional statement is the following:
if not Syntax
elseif Syntax
{{if not signed_up}}
Don't forget to sign up!
{{end}}
{{if signed_up}}
Welcome, thanks for signing up!
{{elseif rejected_sign_up}}
We won't bother you anymore!
{{else}}
Don’t forget to sign up!
{{end}}
15
Conditional Statements: Syntax Examples
The conditional statement is the following:
if empty Syntax
If not empty Syntax
{{ if not empty(orders) }}
Here is a list of your orders
{{else}}
You have no outstanding orders
{{ end }}
{{ if empty(orders) }}
You have no outstanding orders
{{ else }}
Here is the list of your orders
{{ end }}
16
Conditional Statements: Real-world Application
{{if Attending_Insight}}
You'll be on California's central coast in November, so prepare for multiple scenarios. November
temperatures in Monterey average 65/50 with mid to low chance of rain. For up to the minute
weather information for the area, check out <a href="#">weather.com</a>!</p>
&bull; <a href="https://www.google.com/?gws_rd=ssl#q=weather+{{local_city}}">Your Local Area
Weather Report </a><br>
&bull; <a href="https://www.google.com/?gws_rd=ssl#q=weather+{{dest_city}}">Your Destination
Area Weather Report</a><br>
{{else}}
It's not too late to register and attend Insight! Sign up today so you can enjoy the lovely weather on
California's central coast. For weather updates, check out <a href="#">weather.com</a>!</p>
{{end}}
Substitution Data:
“Attending_Insight” : true,
Template:
17
Conditional Statements: Real-world Application
{{if not Airports[departAirport]}}
Hi {{ firstName or 'there' }}, You do not appear to be traveling anywhere. This email must be a
mistake.
{{else}}
{{if Airports[departAirport] and Airports[departAirport].city then}}
Hi {{ firstName or 'there' }}, You are planning a trip from {{departAirport}} in
{{Airports[departAirport].city}} to {{arriveAirport}} in {{Airports[arriveAirport].city}}.
{{end}}
{{end}}
Template:
Substitution Data:
"arriveAirport":"SFO",
"Airports":{
"SFO":{
"code":"SFO",
"city":"San Francisco",
"name":"San Francisco International Airport”,
18
Personalized Links
•  Substitution data can be used to replace part or all of a URL
•  The substitution engine automatically encodes the
substitution values to handle special characters
•  Encoding can be disabled on a per substitution basis
(triple curly brackets)
The ability to render a target URL link containing
one or more substitutions
19
Personalized Links (URL Encoding):
Real-world Application
Personalized Link in Template
<a href="https://www.google.com/?gws_rd=ssl#q=weather+{{local_city}}">Your Local Area
Weather Report </a>
{
“local_city” : “ellicott city”,
}
<a href="https://www.google.com/?gws_rd=ssl#q=weather+ellicott%20city">Your Local
Area Weather Report </a>
Link (with URL encoding) in Email
Substitution Data
20
Personalized Links (Disabling URL Encoding):
Real-world Application
Please be sure to refer your fellow coworkers to sign up to the {{year}} INSIGHT Conference by
sending them to this <a href="{{registration_link}}">link </a> or this <a
href="{{{registration_link}}}">link here</a></a>!</p>
"registration_link": "https://www.regonline.com/register/checkin.aspx?
EventId=1693737&MethodId=0& EventSessionId=&startnewreg=1",
https://www.regonline.com/register/checkin.aspx?
EventId=1693737&MethodId=0&EventSessionId=&startnewreg=1
Template:
Substitution Data:
Actual Link:
21
•  Use render_dynamic_content macro to display chunks
•  Links (including the ability to track them) may appear in
either HTML or text chunks
•  Substitution statements may appear in these chunks
•  Dynamic content must be specified at the transmission level
•  Define substitution as “dynamic_html” and/or “dynamic_text”
Dynamic Content
The ability to embed entire chunks of text or HTML within
substitution data rather than within the template
22
Dynamic Content: Real-world Application
{{if dynamic_html.Options}}
{{render_dynamic_content(dynamic_html.Options[REGISTRATION_OPTION])}}
{{end}}
"REGISTRATION_OPTION": "2",
"dynamic_html": {
"Options":{
"1": "<a href="https://www.regonline.com/register/checkin.aspx?
EventId=1693737&MethodId=0&EventSessionId=&startnewreg=1" target="_blank" style="font:
14px arial,helvetica,sans-serif; color:#003a6f; text-decoration:underline;" title="Register Now
">Register Here Today</a>",
"2": "<a href="https://www.messagesystems.com/insight/agenda" target="_blank" style=
"font:14px arial,helvetica,sans-serif; color:#003a6f; text-decoration:underline;" title="Insight
Conference Agenda">Check Out the Agenda Here</a>",
"3": "<a href="https://www.messagesystems.com/insight/about" target="_blank" style=
"font:14px arial,helvetica,sans-serif; color:#003a6f; text-decoration:underline;" title="About Insight
2015">Learn More About Insight Here</a>” }
Substitution Data
Template Statement:
23
Looping
The ability to iterate over a sequential array
of objects or values (strings)
•  Implement using the “each” keyword and “loop_var” variable
•  Can iterate over more complex data structures, going multiple
levels down (nested looping) using “loop_vars” variable
•  Can use HTML within the loop to generate template content
(tables, text, bullets, lists, etc.)
24
Looping (Simple): Real-world Application
Template Statement:
{{each key_people}}
&bull; {{loop_var }}<br>
{{end}}
"key_people": [
"George Schlossnagle",
"Alec Peterson",
"Mitch Harris",
"Laura Rose",
"Theo Allen"
],
Substitution Data:
25
Looping (Simple): Real-world Application
Template Statement:
{{each districts}}
Key Attraction: {{loop_var.name}}
Distance from Hotel: {{loop_var.proximity_hotel}}
{{end}}
”districts" : [ {
"name" : "Monterey Bay Aquarium",
"proximity_hotel" : "Close",
}, {
"name" : "Lighthouse District",
"proximity_hotel" : "Closer",
}, {
"name" : "Cannery Row",
"proximity_hotel" : "Closest",
} ],
Substitution Data:
26
Looping (Nested): Real-world Application
Template Statement:
”districts" : [
{
"name" : "Monterey Bay Aquarium",
"tourist_attraction" : [
{"location" : "Cindy's Waterfront"},
{"location" : "Jellies Experience (Aquarium)"},
{"location" : "The Aquarium!"}, ]
{{each districts}}
{{loop_vars.districts.name}}
Nearby Places to Visit
{{each loop_vars.districts.tourist_attraction}}
{{loop_vars.tourist_attraction.location}}
{{end}}
{{end}}
Substitution Data:
27
Resources
SparkPost documentation
https://www.sparkpost.com/api#/reference
Momentum documentation
https://support.messagesystems.com/docs/
SparkPost Blog
https://www.sparkpost.com/blog/
SparkPost YouTube channel
https://www.youtube.com/channel/UC5vz6wEfpJjGipY_alrYuhQ
Technical Account Manager/Engagement Manager
28
•  SparkPost documentation
•  Momentum documentation
•  SparkPost Blog
•  SparkPost YouTube
channel
•  Engagement Manager/
Technical Account
Manager
Resources
•  Personalized subject lines
•  Default values for null values
•  Render different content
•  Registration status
•  Departure & arrival airports
•  Customer orders
•  Different weather links
•  Display lists
•  Key people to meet
•  Tourist districts
•  Local attractions per district
Real World
Application
•  Conditional Statements
•  Personalized Links
•  URL encoding
•  Disabling URL
encoding
•  Dynamic Content
•  Looping
•  Simple
•  Nested
Objectives: Recap
Advanced
Functionality
Advanced
Functionality
Real-world
Applications Resources
29
Q & A

More Related Content

PPTX
Introduction to Azure DocumentDB
PPTX
JLIFF: Where we are, and where we're going
PDF
Developing CouchApps
PDF
Insight User Conference Bootcamp - Use the Engagement Tracking and Metrics A...
PDF
Insight User Conference Bootcamp - Multi-Channel with SparkPost Elite
PPTX
Elastic search and Symfony3 - A practical approach
PPTX
Working with LoopBack Models
PDF
Asynchronous single page applications without a line of HTML or Javascript, o...
Introduction to Azure DocumentDB
JLIFF: Where we are, and where we're going
Developing CouchApps
Insight User Conference Bootcamp - Use the Engagement Tracking and Metrics A...
Insight User Conference Bootcamp - Multi-Channel with SparkPost Elite
Elastic search and Symfony3 - A practical approach
Working with LoopBack Models
Asynchronous single page applications without a line of HTML or Javascript, o...

Similar to Insight User Conference Bootcamp - Advanced Templatization (20)

PPT
Java Script Based Client Server Webapps 2
PPTX
Read, store and create xml and json
PDF
Fire-fighting java big data problems
PDF
Unit 4(it workshop)
PDF
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
PDF
Rapid Prototyping with Solr
PDF
Sparkling Water 5 28-14
PDF
What is API - Understanding API Simplified
PDF
Ws rest
PDF
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
PPTX
Elasticsearch
PPTX
Splunk Ninjas: New Features, Pivot, and Search Dojo
PPTX
Bridging Structured and Unstructred Data with Apache Hadoop and Vertica
PPTX
Query in Couchbase. N1QL: SQL for JSON
PDF
Simplifying & accelerating application development with MongoDB's intelligent...
PPT
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
PDF
Querying Linked Data with SPARQL
PDF
PHP and Rich Internet Applications
PDF
MongoDB Europe 2016 - Graph Operations with MongoDB
PDF
Building iot applications with Apache Spark and Apache Bahir
Java Script Based Client Server Webapps 2
Read, store and create xml and json
Fire-fighting java big data problems
Unit 4(it workshop)
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rapid Prototyping with Solr
Sparkling Water 5 28-14
What is API - Understanding API Simplified
Ws rest
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
Elasticsearch
Splunk Ninjas: New Features, Pivot, and Search Dojo
Bridging Structured and Unstructred Data with Apache Hadoop and Vertica
Query in Couchbase. N1QL: SQL for JSON
Simplifying & accelerating application development with MongoDB's intelligent...
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
Querying Linked Data with SPARQL
PHP and Rich Internet Applications
MongoDB Europe 2016 - Graph Operations with MongoDB
Building iot applications with Apache Spark and Apache Bahir
Ad

More from SparkPost (20)

PPTX
Unlocking Email’s Hidden Opportunities to Create a Competitive Advantage
PPTX
SparkPost Celebrates International Women's Day 2020
PDF
PMTA Success Story - J2 Martech
PDF
How Email and Your Culture Can Help Change the World
PDF
Brave New World: Everything you Wanted to Know About Deliverability Updates
PDF
PowerMTA Integration Experiences and Solutions
PDF
Get Ahead of the Game! Our Journey to Rebranding and Success
PDF
Beyond the Norm: Email and the Innovation Ethos
PDF
New features in PMTA 5.0
PDF
Product Roadmap 2019 PMTA Summit
PDF
At the Wheel: An Evolution Story for Email Strategists (and Cyclists)
PDF
Webinar: Retail Banking - Optimizing the Customer Deposit Lifecycle
PDF
SparkPost Celebrates Pride
PDF
How LendingTree is Growing Rapidly with Email and Customer Engagement
PDF
On-Premises and Cloud - Putting the Pieces Together
PDF
Trends and Insights for Interactive Email & Google AMP for Email
PDF
Scaling Your Product with Key Growth Surfaces
PDF
Segmenting Your Way to Smarter Sending
PDF
State of Transactional Email 2018 (Benchmark report)
PDF
GDPR Affects Email Worldwide
Unlocking Email’s Hidden Opportunities to Create a Competitive Advantage
SparkPost Celebrates International Women's Day 2020
PMTA Success Story - J2 Martech
How Email and Your Culture Can Help Change the World
Brave New World: Everything you Wanted to Know About Deliverability Updates
PowerMTA Integration Experiences and Solutions
Get Ahead of the Game! Our Journey to Rebranding and Success
Beyond the Norm: Email and the Innovation Ethos
New features in PMTA 5.0
Product Roadmap 2019 PMTA Summit
At the Wheel: An Evolution Story for Email Strategists (and Cyclists)
Webinar: Retail Banking - Optimizing the Customer Deposit Lifecycle
SparkPost Celebrates Pride
How LendingTree is Growing Rapidly with Email and Customer Engagement
On-Premises and Cloud - Putting the Pieces Together
Trends and Insights for Interactive Email & Google AMP for Email
Scaling Your Product with Key Growth Surfaces
Segmenting Your Way to Smarter Sending
State of Transactional Email 2018 (Benchmark report)
GDPR Affects Email Worldwide
Ad

Recently uploaded (20)

PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
MCP Security Tutorial - Beginner to Advanced
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PPTX
"Secure File Sharing Solutions on AWS".pptx
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PDF
Types of Token_ From Utility to Security.pdf
PDF
Time Tracking Features That Teams and Organizations Actually Need
PPTX
Cybersecurity: Protecting the Digital World
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PDF
AI Guide for Business Growth - Arna Softech
PDF
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
PDF
Website Design Services for Small Businesses.pdf
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PDF
Microsoft Office 365 Crack Download Free
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PDF
Visual explanation of Dijkstra's Algorithm using Python
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PDF
Salesforce Agentforce AI Implementation.pdf
Why Generative AI is the Future of Content, Code & Creativity?
MCP Security Tutorial - Beginner to Advanced
Weekly report ppt - harsh dattuprasad patel.pptx
"Secure File Sharing Solutions on AWS".pptx
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Types of Token_ From Utility to Security.pdf
Time Tracking Features That Teams and Organizations Actually Need
Cybersecurity: Protecting the Digital World
Computer Software and OS of computer science of grade 11.pptx
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
AI Guide for Business Growth - Arna Softech
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
Website Design Services for Small Businesses.pdf
Oracle Fusion HCM Cloud Demo for Beginners
Microsoft Office 365 Crack Download Free
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
Visual explanation of Dijkstra's Algorithm using Python
Patient Appointment Booking in Odoo with online payment
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Salesforce Agentforce AI Implementation.pdf

Insight User Conference Bootcamp - Advanced Templatization

  • 1. 1 Isaac Kim & Fiona Snoddy Advanced Templatization November 3, 2015
  • 2. 2 Fiona Snoddy •  Celebrating 1-year anniversary with SparkPost •  Worked on several SPE implementations, including our very first! •  Lives in Columbia, MD •  Loves working-out, water-skiing and watching rugby & ice-hockey
  • 4. 4 Isaac Kim •  Been with SparkPost for 8 months •  Supports both SPE and Momentum implementations •  Lives in Columbia, MD •  Loves fishing, CrossFit, and recently started up archery
  • 5. 5 Chris Arnold - Template Guru
  • 6. 6 Objectives Exposure to Advanced Template Functionality Insight into Real-world Applications Knowledge of Resources
  • 7. 7 Agenda •  Templating Overview •  Conditional Statements •  Personalized Links ­  URL encoding ­  Disabling URL encoding •  Dynamic Content •  Looping ­  Simple ­  Nested •  Q & A
  • 8. 8 Approach: The Bears are Heading to Insight
  • 9. 9 Transmission Substitution Data Conditional IF not Statement Triple Curly Escape URL Link Conditional IF Statement Encoded URL Link Complex Conditional Statement Dynamic Content Simple Loop Simple Loop with Multiple Objects Nested Loop with Objects
  • 10. 10 Template features accessible on… SparkPost SparkPost Elite Momentum Template Functionality
  • 11. 11 Templating Overview •  Substitution data can be specified at the transmission and/or recipient level •  Defined as a JSON object of key/value pairs •  Substitute using double curly brackets •  Substitution data can be used in both text and HMTL templates •  Metadata can be also be used as substitution data JSON substitution data can be combined with a template to personalize the recipient’s text, HTML and subject line
  • 12. 12 Template: Templating Overview: Real-world Application { "firstName” : "Papa Bear” } Substitution Data: Welcome to Insight {{firstName}}!
  • 13. 13 Conditional Statements •  Can be used standalone as well as in expressions •  Multiple syntax options ­  If then else ­  If not ­  Elseif ­  If empty ­  If not empty •  Can be complex ­  combine with basic/robust substitutions ­  Concatenated conditions i.e. if A and B and C = x then The ability to render different per recipient content based on a given condition(s)
  • 14. 14 Conditional Statements: Syntax Examples The conditional statement is the following: if not Syntax elseif Syntax {{if not signed_up}} Don't forget to sign up! {{end}} {{if signed_up}} Welcome, thanks for signing up! {{elseif rejected_sign_up}} We won't bother you anymore! {{else}} Don’t forget to sign up! {{end}}
  • 15. 15 Conditional Statements: Syntax Examples The conditional statement is the following: if empty Syntax If not empty Syntax {{ if not empty(orders) }} Here is a list of your orders {{else}} You have no outstanding orders {{ end }} {{ if empty(orders) }} You have no outstanding orders {{ else }} Here is the list of your orders {{ end }}
  • 16. 16 Conditional Statements: Real-world Application {{if Attending_Insight}} You'll be on California's central coast in November, so prepare for multiple scenarios. November temperatures in Monterey average 65/50 with mid to low chance of rain. For up to the minute weather information for the area, check out <a href="#">weather.com</a>!</p> &bull; <a href="https://www.google.com/?gws_rd=ssl#q=weather+{{local_city}}">Your Local Area Weather Report </a><br> &bull; <a href="https://www.google.com/?gws_rd=ssl#q=weather+{{dest_city}}">Your Destination Area Weather Report</a><br> {{else}} It's not too late to register and attend Insight! Sign up today so you can enjoy the lovely weather on California's central coast. For weather updates, check out <a href="#">weather.com</a>!</p> {{end}} Substitution Data: “Attending_Insight” : true, Template:
  • 17. 17 Conditional Statements: Real-world Application {{if not Airports[departAirport]}} Hi {{ firstName or 'there' }}, You do not appear to be traveling anywhere. This email must be a mistake. {{else}} {{if Airports[departAirport] and Airports[departAirport].city then}} Hi {{ firstName or 'there' }}, You are planning a trip from {{departAirport}} in {{Airports[departAirport].city}} to {{arriveAirport}} in {{Airports[arriveAirport].city}}. {{end}} {{end}} Template: Substitution Data: "arriveAirport":"SFO", "Airports":{ "SFO":{ "code":"SFO", "city":"San Francisco", "name":"San Francisco International Airport”,
  • 18. 18 Personalized Links •  Substitution data can be used to replace part or all of a URL •  The substitution engine automatically encodes the substitution values to handle special characters •  Encoding can be disabled on a per substitution basis (triple curly brackets) The ability to render a target URL link containing one or more substitutions
  • 19. 19 Personalized Links (URL Encoding): Real-world Application Personalized Link in Template <a href="https://www.google.com/?gws_rd=ssl#q=weather+{{local_city}}">Your Local Area Weather Report </a> { “local_city” : “ellicott city”, } <a href="https://www.google.com/?gws_rd=ssl#q=weather+ellicott%20city">Your Local Area Weather Report </a> Link (with URL encoding) in Email Substitution Data
  • 20. 20 Personalized Links (Disabling URL Encoding): Real-world Application Please be sure to refer your fellow coworkers to sign up to the {{year}} INSIGHT Conference by sending them to this <a href="{{registration_link}}">link </a> or this <a href="{{{registration_link}}}">link here</a></a>!</p> "registration_link": "https://www.regonline.com/register/checkin.aspx? EventId=1693737&MethodId=0& EventSessionId=&startnewreg=1", https://www.regonline.com/register/checkin.aspx? EventId=1693737&MethodId=0&EventSessionId=&startnewreg=1 Template: Substitution Data: Actual Link:
  • 21. 21 •  Use render_dynamic_content macro to display chunks •  Links (including the ability to track them) may appear in either HTML or text chunks •  Substitution statements may appear in these chunks •  Dynamic content must be specified at the transmission level •  Define substitution as “dynamic_html” and/or “dynamic_text” Dynamic Content The ability to embed entire chunks of text or HTML within substitution data rather than within the template
  • 22. 22 Dynamic Content: Real-world Application {{if dynamic_html.Options}} {{render_dynamic_content(dynamic_html.Options[REGISTRATION_OPTION])}} {{end}} "REGISTRATION_OPTION": "2", "dynamic_html": { "Options":{ "1": "<a href="https://www.regonline.com/register/checkin.aspx? EventId=1693737&MethodId=0&EventSessionId=&startnewreg=1" target="_blank" style="font: 14px arial,helvetica,sans-serif; color:#003a6f; text-decoration:underline;" title="Register Now ">Register Here Today</a>", "2": "<a href="https://www.messagesystems.com/insight/agenda" target="_blank" style= "font:14px arial,helvetica,sans-serif; color:#003a6f; text-decoration:underline;" title="Insight Conference Agenda">Check Out the Agenda Here</a>", "3": "<a href="https://www.messagesystems.com/insight/about" target="_blank" style= "font:14px arial,helvetica,sans-serif; color:#003a6f; text-decoration:underline;" title="About Insight 2015">Learn More About Insight Here</a>” } Substitution Data Template Statement:
  • 23. 23 Looping The ability to iterate over a sequential array of objects or values (strings) •  Implement using the “each” keyword and “loop_var” variable •  Can iterate over more complex data structures, going multiple levels down (nested looping) using “loop_vars” variable •  Can use HTML within the loop to generate template content (tables, text, bullets, lists, etc.)
  • 24. 24 Looping (Simple): Real-world Application Template Statement: {{each key_people}} &bull; {{loop_var }}<br> {{end}} "key_people": [ "George Schlossnagle", "Alec Peterson", "Mitch Harris", "Laura Rose", "Theo Allen" ], Substitution Data:
  • 25. 25 Looping (Simple): Real-world Application Template Statement: {{each districts}} Key Attraction: {{loop_var.name}} Distance from Hotel: {{loop_var.proximity_hotel}} {{end}} ”districts" : [ { "name" : "Monterey Bay Aquarium", "proximity_hotel" : "Close", }, { "name" : "Lighthouse District", "proximity_hotel" : "Closer", }, { "name" : "Cannery Row", "proximity_hotel" : "Closest", } ], Substitution Data:
  • 26. 26 Looping (Nested): Real-world Application Template Statement: ”districts" : [ { "name" : "Monterey Bay Aquarium", "tourist_attraction" : [ {"location" : "Cindy's Waterfront"}, {"location" : "Jellies Experience (Aquarium)"}, {"location" : "The Aquarium!"}, ] {{each districts}} {{loop_vars.districts.name}} Nearby Places to Visit {{each loop_vars.districts.tourist_attraction}} {{loop_vars.tourist_attraction.location}} {{end}} {{end}} Substitution Data:
  • 27. 27 Resources SparkPost documentation https://www.sparkpost.com/api#/reference Momentum documentation https://support.messagesystems.com/docs/ SparkPost Blog https://www.sparkpost.com/blog/ SparkPost YouTube channel https://www.youtube.com/channel/UC5vz6wEfpJjGipY_alrYuhQ Technical Account Manager/Engagement Manager
  • 28. 28 •  SparkPost documentation •  Momentum documentation •  SparkPost Blog •  SparkPost YouTube channel •  Engagement Manager/ Technical Account Manager Resources •  Personalized subject lines •  Default values for null values •  Render different content •  Registration status •  Departure & arrival airports •  Customer orders •  Different weather links •  Display lists •  Key people to meet •  Tourist districts •  Local attractions per district Real World Application •  Conditional Statements •  Personalized Links •  URL encoding •  Disabling URL encoding •  Dynamic Content •  Looping •  Simple •  Nested Objectives: Recap Advanced Functionality Advanced Functionality Real-world Applications Resources