Skip to main content
Skip table of contents

Template rendering (REST only)

Template Rendering enables the customer to integrate email templates within the REST request. This reduces the amount of data to be transferred. Using the email templates, the customer can address several recipients in a personalized way. Each template contains a subject line, a text part and an HTML part, each of which can contain different variables, e.g. {{{name}}},{{invoice}}}. Retarus automatically prepares the emails generated in this way for high-volume sending. Retarus Templating uses the standard of the Freemarker template procedure.

image-20240507-144747.png

Freemaker template (JSON)

Each template contains a subject line, a text part and an HTML part which can contain different variables. The personalized information is automatically set by Retarus and prepared for high-volume dispatch. Retarus  Templating uses the standard of the Freemarker Template procedure. For example, you can include a variable {{{name}}} in the text of your email. When sending the email, specify the value of {{name}} for each recipient. The Retarus Freemarker Template service will then automatically replace the {{{name}}} variable with the first name of the recipient.

JSON
{
   "subject":{
      "contentTransferEncoding":"base64",
      "template":"Send Job - POST - template basic ${name}"
   },
   "body":{
      "contentType":"text/html",
      "contentTransferEncoding":"base64",
      "template":"Send Job - POST - template basic ${name}"
   },
   "alternative":{
      "contentTransferEncoding":"base64",
      "template":"Send Job - POST - template basic ${name}"
   },
   "recipients":[
      {
         "mail":{
            "to":[
               {
                  "email":" to_friendly<to@example.com>"
               }
            ],
            "listUnsubscribe":""
         },
         "features":{
            "templating":{
               "personalization":{
                  "name":"Ignaz"
               }
            }
         }
      }
   ],
   "mail":{
      "from":{
         "email":"smpt_from_friendly<smtp-from@example.com>"
      },
      "mimeFrom":{
         "email":"mime_from_friendly<mime-from@example.com>"
      },
      "replyTo":{
         "email":"rt_friendly<replyTo@example.com>"
      },
      "inReplyTo":"in-reply-to@example.com",
      "priority":"NORMAL"
   },
   "job":{
      "referenceJob":"rcpt-632cdc56-6480-406b-8faf-5a7e70876d0c",
      "costCenter":"cost-center",
      "campaignId":"zOsVEmBBV3TYzTPe",
      "features":{
         "openTracking":{
            "active ":true
         },
         "linkTracking":{
            "active ":true
         },
         "templating":{
            "active":true
         }
      }
   }
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.