{"id":1231,"date":"2018-01-22T15:26:52","date_gmt":"2018-01-22T15:26:52","guid":{"rendered":"https:\/\/help.dopplerrelay.com\/es\/?p=1231"},"modified":"2018-01-24T20:45:23","modified_gmt":"2018-01-24T20:45:23","slug":"how-to-create-templates-in-doppler-relay","status":"publish","type":"post","link":"https:\/\/help.dopplerrelay.com\/en\/how-to-create-templates-in-doppler-relay\/","title":{"rendered":"How to create templates in Doppler Relay"},"content":{"rendered":"<p>To create a template in Doppler Relay you must <a href=\"https:\/\/app.dopplerrelay.com\/#\/login?lang=en\" target=\"_blank\" rel=\"noopener\">enter your account<\/a>, and access the section called Templates. Once there you will see a button with the option to <b>create a new template.<\/b><\/p>\n<p>You will be redirected to a new page where you will see these 4 fields.<\/p>\n<ul>\n<li><b>Template name:<\/b> This field is for internal use, so you can include an identifying name in your template dashboard.<\/li>\n<li><b>Email Subject:<\/b> Here you can determine the subject of this specific Transactional Email.<\/li>\n<li><b>Sender&#8217;s Name:<\/b> Write here how the sender will appear in customer&#8217;s inbox. For example, you can include something like John from Doppler Relay.<\/li>\n<li><b>Sender&#8217;s Email:<\/b> Finally you can also determine sender&#8217;s email. It is very important to improve not only the opening of your emails but also for your customers to associate an email to your company.<\/li>\n<\/ul>\n<p>Once finished this, is time to create your template. To be able to customize the HTML of your template it is necessary to use dynamic fields.<\/p>\n<h2>What is a dynamic field?<\/h2>\n<p>Dynamic fields are part of the Email content that is modified based on client\u2019s information. Dynamic fields allow you to personalize messages and include personal information for each client.<\/p>\n<h2>How to build a dynamic field?<\/h2>\n<p>The Doppler Relay templates use a very simple, but very powerful language, called <a href=\"https:\/\/mustache.github.io\/\" target=\"_blank\" rel=\"noopener\">Mustache<\/a>. This language includes some advanced features that make it ideal for writing texts and HTML.<\/p>\n<p>As with other template languages, start and end markers are defined as double braces. For example:<\/p>\n<pre><code>{{value}}<\/code><\/pre>\n<p>The blank space inside the keys is ignored. All of the following are equivalent:<\/p>\n<pre><code>{{ value }}\r\n{{value}}\r\n{{ \u00a0value \u00a0\u00a0}}<\/code><\/pre>\n<p>If you have a template model like this (represented as JSON):<\/p>\n<pre><code>{\r\n\"user\" : {\r\n\"name\" : \"John\",\r\n  }\r\n}<\/code><\/pre>\n<p>And this template<\/p>\n<pre><code>Hi {{user.name}} <\/code><\/pre>\n<p>Mustache will produce this content when you combine both:<\/p>\n<pre><code>Hi John<\/code><\/pre>\n<p>Mustache is permissive about the values lost in its models. If you search for a property that doesn\u2019t exist, Mustache will skip that section.<\/p>\n<p>In this way, you can create templates that do not require if \/ else logic.<\/p>\n<p>Using the following model:<\/p>\n<pre><code>{\r\n  \"company\" : \"Doppler Relay\",\r\n  \"employees\" : [\r\n    { \"name\" : \"John\", \"role\" : \"IT Architect\" },\r\n    { \"name\" : \"Miguel\" }\r\n  ]\r\n}<\/code><\/pre>\n<p>The template would be something like this:<\/p>\n<pre><code>&lt;ul&gt;\r\n  {{#employees}}\r\n   &lt;li&gt;\r\n     {{name}} works for: {{company}}\r\n     {{#role}}como {{.}}{{\/role}}\r\n   &lt;\/li&gt;\r\n  {{\/employees}}\r\n&lt;\/ul&gt;<\/code><\/pre>\n<p>When we use Mustache we will produce the following HTML:<\/p>\n<pre><code>&lt;ul&gt;\r\n  &lt;li&gt;John woks for: Doppler Relay as IT Architect&lt;\/li&gt;\r\n  &lt;li&gt;Miguel works for: Doppler Relay&lt;\/li&gt;\r\n&lt;\/ul&gt;<\/code><\/pre>\n<p>Substitutions are applied by recipient using replacement data provided as part of the transmission and recipient JSON structures.<\/p>\n<p>In the simplest case, <strong>the substitution data is a JSON object of recipient-specific key\/data value pairs<\/strong>. In a more complex case, the substitution data can consist of nested JSON objects and even arrays of objects.<\/p>\n<p>This allows you to write statements that run through an array of JSON objects and substitute values that exist in each object in the array, for example, an array of customer orders.<\/p>\n<pre><code>{\r\n\"name\" : \"Juan\",\r\n\"age\" : 27,\r\n\"state\" : \"MD\",\r\n\"is_member\" : true\r\n}<\/code><\/pre>\n<p>In this case, your dynamic fields would be the following:<\/p>\n<ul>\n<li>{{name}}<\/li>\n<li>{{age}}<\/li>\n<li>{{state}}<\/li>\n<li>{{is-member}}<\/li>\n<\/ul>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Discover how to create a template in Doppler Relay and how to use dynamic fields to create custom Transactional Emails<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[130,30],"tags":[140,138,113,139],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C\u00f3mo crear plantillas en Doppler Relay<\/title>\n<meta name=\"description\" content=\"Descubre c\u00f3mo se crea una plantilla en Doppler Relay y c\u00f3mo utilizar los campos din\u00e1micos para crear Emails Transaccionales personalizados\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C\u00f3mo crear plantillas en Doppler Relay\" \/>\n<meta property=\"og:description\" content=\"Descubre c\u00f3mo se crea una plantilla en Doppler Relay y c\u00f3mo utilizar los campos din\u00e1micos para crear Emails Transaccionales personalizados\" \/>\n<meta property=\"og:url\" content=\"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/\" \/>\n<meta property=\"og:site_name\" content=\"Doppler Relay Help\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-22T15:26:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-24T20:45:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/help.dopplerrelay.com\/wp-content\/uploads\/2017\/08\/share-facebook.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"428\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Juan Pablo Castro\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/help.dopplerrelay.com\/es\/#website\",\"url\":\"https:\/\/help.dopplerrelay.com\/es\/\",\"name\":\"Doppler Relay Help\",\"description\":\"Otro sitio realizado con WordPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/help.dopplerrelay.com\/es\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/#webpage\",\"url\":\"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/\",\"name\":\"C\u00f3mo crear plantillas en Doppler Relay\",\"isPartOf\":{\"@id\":\"https:\/\/help.dopplerrelay.com\/es\/#website\"},\"datePublished\":\"2018-01-22T15:26:52+00:00\",\"dateModified\":\"2018-01-24T20:45:23+00:00\",\"author\":{\"@id\":\"https:\/\/help.dopplerrelay.com\/es\/#\/schema\/person\/df209552777e7a4900fd8044f734ca58\"},\"description\":\"Descubre c\u00f3mo se crea una plantilla en Doppler Relay y c\u00f3mo utilizar los campos din\u00e1micos para crear Emails Transaccionales personalizados\",\"breadcrumb\":{\"@id\":\"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/help.dopplerrelay.com\/es\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C\u00f3mo crear plantillas en Doppler Relay\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/help.dopplerrelay.com\/es\/#\/schema\/person\/df209552777e7a4900fd8044f734ca58\",\"name\":\"Juan Pablo Castro\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/help.dopplerrelay.com\/es\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cfd6563abae40adcf5a25f4409b74a17?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cfd6563abae40adcf5a25f4409b74a17?s=96&d=mm&r=g\",\"caption\":\"Juan Pablo Castro\"},\"url\":\"https:\/\/help.dopplerrelay.com\/en\/author\/jpcastro\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C\u00f3mo crear plantillas en Doppler Relay","description":"Descubre c\u00f3mo se crea una plantilla en Doppler Relay y c\u00f3mo utilizar los campos din\u00e1micos para crear Emails Transaccionales personalizados","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/","og_locale":"en_US","og_type":"article","og_title":"C\u00f3mo crear plantillas en Doppler Relay","og_description":"Descubre c\u00f3mo se crea una plantilla en Doppler Relay y c\u00f3mo utilizar los campos din\u00e1micos para crear Emails Transaccionales personalizados","og_url":"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/","og_site_name":"Doppler Relay Help","article_published_time":"2018-01-22T15:26:52+00:00","article_modified_time":"2018-01-24T20:45:23+00:00","og_image":[{"width":700,"height":428,"url":"https:\/\/help.dopplerrelay.com\/wp-content\/uploads\/2017\/08\/share-facebook.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Juan Pablo Castro","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/help.dopplerrelay.com\/es\/#website","url":"https:\/\/help.dopplerrelay.com\/es\/","name":"Doppler Relay Help","description":"Otro sitio realizado con WordPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/help.dopplerrelay.com\/es\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/#webpage","url":"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/","name":"C\u00f3mo crear plantillas en Doppler Relay","isPartOf":{"@id":"https:\/\/help.dopplerrelay.com\/es\/#website"},"datePublished":"2018-01-22T15:26:52+00:00","dateModified":"2018-01-24T20:45:23+00:00","author":{"@id":"https:\/\/help.dopplerrelay.com\/es\/#\/schema\/person\/df209552777e7a4900fd8044f734ca58"},"description":"Descubre c\u00f3mo se crea una plantilla en Doppler Relay y c\u00f3mo utilizar los campos din\u00e1micos para crear Emails Transaccionales personalizados","breadcrumb":{"@id":"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/help.dopplerrelay.com\/es\/como-crear-plantillas-en-doppler-relay\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/help.dopplerrelay.com\/es\/"},{"@type":"ListItem","position":2,"name":"C\u00f3mo crear plantillas en Doppler Relay"}]},{"@type":"Person","@id":"https:\/\/help.dopplerrelay.com\/es\/#\/schema\/person\/df209552777e7a4900fd8044f734ca58","name":"Juan Pablo Castro","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/help.dopplerrelay.com\/es\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cfd6563abae40adcf5a25f4409b74a17?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cfd6563abae40adcf5a25f4409b74a17?s=96&d=mm&r=g","caption":"Juan Pablo Castro"},"url":"https:\/\/help.dopplerrelay.com\/en\/author\/jpcastro\/"}]}},"_links":{"self":[{"href":"https:\/\/help.dopplerrelay.com\/en\/wp-json\/wp\/v2\/posts\/1231"}],"collection":[{"href":"https:\/\/help.dopplerrelay.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.dopplerrelay.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.dopplerrelay.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/help.dopplerrelay.com\/en\/wp-json\/wp\/v2\/comments?post=1231"}],"version-history":[{"count":34,"href":"https:\/\/help.dopplerrelay.com\/en\/wp-json\/wp\/v2\/posts\/1231\/revisions"}],"predecessor-version":[{"id":1269,"href":"https:\/\/help.dopplerrelay.com\/en\/wp-json\/wp\/v2\/posts\/1231\/revisions\/1269"}],"wp:attachment":[{"href":"https:\/\/help.dopplerrelay.com\/en\/wp-json\/wp\/v2\/media?parent=1231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.dopplerrelay.com\/en\/wp-json\/wp\/v2\/categories?post=1231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.dopplerrelay.com\/en\/wp-json\/wp\/v2\/tags?post=1231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}