Templates

Templates are the content block of your notification. In SuprSend, content for all channels (SMS, email, chat, push etc.) is grouped under a single template group for simplified management. Your template can have 2 types of content:

  • Static Content: This remains the same for all users and contains your core message or design.
  • Dynamic Content: These are placeholders for user or tenant-specific information, such as first names, booking amounts, appointment times, and more. The variables are populated dynamically based on the data provided in your workflow or event request.

Benefits of Templates with SuprSend:

  • Unified Content Management: Content for all channels is grouped together in a single template, making it easy to manage your content in one place.
  • WYSWYG editors: Designing a template is a piece of cake with drag-and-drop and form editors. Your product managers and designers can take control of content creation without involving developers.
  • Multi-Lingual support: You can add content for multiple languages in a single template and the user will receive notification in their preferred language
  • Create white-labeled notifications for your tenants with ease: You can create brands for your own company and each of your tenants. Use it to dynamically change your email template styling to match the brand's identity.
  • Easy to iterate: You can directly design and store templates on the SuprSend dashboard, decoupling templates from your code.
  • Version control: Each template change is published as a new version, so you can always track historical changes. You can also monitor user engagement for each version and retain the one that performs better. Trigger a test notification on your current live version to see the content preview on your actual device before pushing it to production.
  • Add / Remove channels without touching code: To add any channel to your existing template group, you need to simply design a template for that channel on SuprSend platform and publish it. Notifications will start going through that channel, with no alterations to your existing code.

Template Designer

SuprSend's template designer empowers you to create beautiful templates with easy drag-and-drop editor

Create a template


Add a template name and Click on "Save"


The new Template will be created, which you can see on the top of 'Templates' listing page. Click on the template to start editing.


Select the Channel

Select the channel that you want to edit and enable it


Add template content

You can get the detailed guide to design the template for each channel in their respective documents:


Template Versions:

SuprSend creates a new version every time you publish a template. This is to ensure that you have historical reference to all the changes done in your template. Helps with audit trails and understanding which template content performed better in terms of user engagement.

  • A draft version is created by default. You'll always do your changes in the draft version and publish the template once finalized.
  • The recent published template will become the live version. All your notifications will be using the live template version.
  • Earlier published versions will become inactive as soon as you publish a new template. You can see inactive template versions by selecting "All" tab from the top right side options.

Adding dynamic content

We use handlebarsjs as the template variables language. You can learn about handlebarsjs here.

  1. To add dynamic data, first add the variable data from your event and workflow request in the mock data.

  1. Often times there is a mismatch between template variables and the data that come as part of payload of the trigger or event. Defining the JSON structure of variables before hand reduces the chances of error.
  2. The variables will show as auto-suggestions while designing the template, reducing the possibility of typo errors.
  3. Once declared, these variables can be used consistently across all channels for that particular template.
  4. The sample values are used to send test notification and show the preview of final notification.

In the above screenshot, there are other elements in the mock data like brand and batching. You can check their respective documentation to know more about it.

You can copy below mock data for starters:

{
  "name": "Steve",
  "items": [
    {
      "item": "Jager-Smith Premium",
      "tracking_id": "FMPP14677458796",
      "delivery_date": "22 June, 2023"
    },
    {
      "item": "Winget Women Cap",
      "tracking_id": "FMPP7734374844765",
      "delivery_date": "23 June, 2023"
    }
  ],
  "amount": "$3,249",
  "tracking_link": "https://www.example.com/track"
}

Using variables in the templates:

As a general rule, all the variables have to be entered within double curly brackets: {{variable_name}}. For URLs and links, we recommend using triple curly braces{{{url}}}.This is to avoid escaping html entities in handlebars. You can also write transformations like date-time formatting, if-else statement inside your templates using handlebar helpers.

Other than your workflow data variables, you can also add other type of variables in your templates like brand properties. See a full list of possible variables here.

There are slight differences in variable format and placement for different templates. Checkout each channel template documentation for reference.


Preview and Publish

You can see the notification preview on the right side of your editor for most of the channels. Variables in template are replaced with the values from mock data for preview

For email, preview option is available in the bottom left side menu

For Slack, you can click on "Load preview" button to see the preview

Once finalized, you can publish the template by clicking on "Publish template" button on the draft version


Testing the template

You can send test notifications directly from the template editor page to see how the message will appear on user's device. To send a test notification,

  • Click on the "Test" button on the top right corner.
  • Add the distinct_id of the user, and click on search. It will show all the available channels for the user.
  • Choose the relevant channels on which you'd like to test, and then click on Trigger Test using mock data. This will trigger a test notification. Go to logs to monitor the real-time status of your sent notification.

JSON data added in the global "Mock Data" button will be used to render variables in the template. Make sure to add mock data for all the variables added in the template else notifications will fail.



Defining template in your workflow request

The template slug serves as a unique identifier for referencing a template in workflows created through API. To copy the slug name, click on the clipboard next to the Template name.



Edit template name and other details

You can edit the template description, name, and add tags to the template by clicking on the edit icon next to the its name.

  • We recommend adding your template trigger logic and other relevant notes pertaining to the notification in thedescription. This is helpful for later reference and note keeping.
  • Tags are used for better organization of the templates on listing page. You can group similar templates using tags. Tags can then be used to filter out templates on listing page and also while fetching templates through API.

Clone template

To avoid designing templates from scratch, you can clone your existing templates and design on top of it.


Adding multiple languages

SuprSend allows you to create notifications in multiple languages in the same template. Once the languages are added, SuprSend will pick the preferred language from user's profile and send the message as per the user's preferred language. You can add template languages using Language option from the top-right corner burger menu. For more details, check steps and guidelines on adding language.


Archive template

You can archive your unused templates by clicking on "Archive" option from the top-right corner burger menu.


View and filter your template list

All of your active templates will be visible on the template listing page. You can filter your templates by channel, tag, status or just get the templates which were edited by you.


Archived templates can be seen by clicking on Archived tab from the top right side options