SlideShare a Scribd company logo
1 of 29
Download to read offline
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

Similar to Insight User Conference Bootcamp - Advanced Templatization

Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2
kriszyp
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
Erik Hatcher
 
Sparkling Water 5 28-14
Sparkling Water 5 28-14Sparkling Water 5 28-14
Sparkling Water 5 28-14
Sri Ambati
 
Bridging Structured and Unstructred Data with Apache Hadoop and Vertica
Bridging Structured and Unstructred Data with Apache Hadoop and VerticaBridging Structured and Unstructred Data with Apache Hadoop and Vertica
Bridging Structured and Unstructred Data with Apache Hadoop and Vertica
Steve Watt
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
Kiril Iliev
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applications
elliando dias
 

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

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

More from SparkPost

More from SparkPost (20)

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

Recently uploaded

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 

Recently uploaded (20)

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

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