Skip to main content
Skip table of contents

Template rendering

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

Known limitations

Template Rendering has the following known limitations. Read them carefully to make sure you understand the impact before using this feature.

  • Maximum number of recipients for the same JobRequest: 100;

  • Maximum email size: 1 Mb.

Using Template Rendering feature for large email size and/or several recipients at once will increase the processing duration, and in the least favorable scenario, it could result in a processing error after accepting the JobRequest.

To mitigate these limitations, we recommend that you to split your JobRequest into several ones. By declaring fewer recipients by JobRequest for instance.

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.