In-App Inbox Template

This section is a step-by-step guide on how to design and publish an In-App Inbox notification template.

Design Template

You can design template with a simple form editor tool. You can add variables with Handlebarsjs language. You can check how the message will look in the preview section on the right side.
Once designed, you can save the push notification template by clicking on Save Draft. When you are ready, you can Publish Draft by providing a name to the version. This will become the Live version, and will be used whenever the associated workflow is triggered.


1094

In-App Inbox Fields Description

FieldDescription
HeaderSmall message text box. Note that this field will be displayed in single line only, and very long content can get curtailed.
Use handlebarsjs to add variables.
TextLarge message text box. Can add multi-line texts. Use handlebarsjs to add variables.
Action URLProvide a URL where a user will go when he clicks on the push notification. You can give your android deeplink URL as well.
Advanced Configuration -> Extra Json DataOptional field to add extra data that you might to pass to your app to customize the inbox view.
JSON object needs to be added here. Use handlebarsjs to add variables.

Adding Dynamic Content in the template

There will always be the case where you would require to add dynamic content to a template, so as to personalise it for your users. To achieve this, you can add variables in the template, which will be replaced with the dynamic content at the time of sending the message. You'll need to pass these while triggering the communication from one of our frontend or backend SDKs.
Here is a step-by-step guide on how to add dynamic content in Inbox:

Step 1: Declaring Variables in the global 'Mock data' button

To see how to declare variables before using them in designing templates, refer to this section in the Templates documentation.

Step 2: Using variables in the templates

Once the variables are declared, you can use them while designing the android push template. We support handlebarsjs to add variables in the template. As a general rule, all the variables have to be entered within double curly brackets: **{{variable_name}}**

If you have declared the variables in the global 'Mock data' button, then they will come as auto-suggestions when you type a curly bracket {. This will remove the chances of errors like variable mismatch at the time of template rendering.

Note that you will be able to enter a variable name even when you have not declared it inside the 'Variables' button. To manually enter the variable name, follow the handlerbarsjs guide here.

Below is an example of how to enter variables in the template design. For illustration, we are using the same sample variable names that we declared in the 'Templates' section:

{
  "array": [
    {
      "product_name": "Aldo Sling Bag",
      "product_price": "3,950.00"
    },
    {
      "product_name": "Clarles & Keith Women Slipper, Biege, 38UK",
      "product_price": "2,549.00"
    },
    {
      "product_name": "RayBan Sunglasses",
      "product_price": "7,899.00"
    }
  ],
  "event": {
    "location": {
      "city": "Bangalore",
      "state": "KA"
    },
    "order_id": "11200123",
    "first_name": "Nikita"
  },
  "product_page": "https://www.suprsend.com"
}
  1. To enter a nested variable, enter in the format {{var1.var2.var3}}. Eg. to refer to city in the example above, you need to enter {{event.location.city}}
  2. To refer to an array element, enter in format {{var1.[*index*].var2}}. Eg. to refer to product_nameof the first element of the arrayarray, enter {{array.[0].product_name}}`
  3. If you have any space in the variable name, enclose it in square bracket {{event.[first name]}}

You will be able to see the sample values in the Preview section, as well as in the Live version when you publish a draft.
If you cannot see your variable being rendered with the sample value, check one of the following:

  1. Make sure you have entered the variable name and the sample value in the Variables button.
  2. Make sure you have entered the correct variable name in the template, as per the handlebarsjs guideline.

1324



🚧

What happens if there is variable mismatch at the time of sending?

At the time of sending communication, if there is a variable present in the template whose value is not rendered due to mismatch or missing, SuprSend will simply discard the template and not send that particular notification to your user.

Please note that the rest of the templates will be sent. Eg. if there is an error in rendering Android Push template, but email template is successfully rendered, Android Push notification will not be triggered, but email notification will be triggered by SuprSend.


What’s Next

After template creation, you'll need to integrate Inbox SDK in your website to generate Inbox token