Notifications Guide v1
Notifications
Version 1

Create templates

Copy link

Templates are the core of how Sendbird Notifications works. These pre-formatted, customizable message designs allow brands to send personalized in-app notifications by building and using multiple templates for each channel. Templates can be created and customized on Sendbird Dashboard without writing code. This allows non-engineers such as, product managers and marketers, to easily compose up to 100 different templates and send notifications that fit the right use case needs.


How it works

Copy link

As templates are the starting point for Notifications, create a template on Sendbird Dashboard before sending and receiving the notification. The template creation is largely composed of two part: basic template settings and Template editor.

In the first step, select which channel the template will be used for: either Feed view channel or Chat view channel and determine if you wish to send a push notification of the messages sent through the template. Then use Template editor to set variables, which allows the flexibility in personalizing notification content.

See the create templates section for detailed instructions.

Note: If you wish to use a new channel dedicated to a specific use case, create a new channel first in the Channels page and then create a template.


Create templates on the dashboard

Copy link

To create or edit a template on Sendbird Dashboard, select your Sendbird application and navigate to Notifications > Templates. When creating or editing a template, the available fields depend on; whether the selected channel is a Chat or Feed channel; whether Label is enabled; additionally, for Feed channels, whether Category Filter is enabled.

Template

Copy link

  • Channel (required): Select a channel associated with the template. Sendbird Notifications provide two default channels, one per channel type. However, if you wish to use a new channel dedicated to a specific use case, create a new channel first in the Channels page and then create a template. To learn more, see the Channel page.
  • Name (required): Specify a human readable name of the template.
  • Key (required): Specify a unique ID for this template.
  • Category: Select a category associated to the template when this functionality is enabled at the channel level. Category is for Feed type channels only and can act as a filter in the UI once enabled at the channel level. To learn more, see the Channel page.
  • Label: The Label given to the template when this functionality is enabled at the channel level. Label is available for both Feed and Chat types. On the UI, it is an additional text that can be displayed at the top left of the notification message.
  • Push notification: Determines whether the Notification message should send a push notification. You can specify its title and body text. When sending a notification, this can be overridden.
  • Alternative text (required): If push notification is set to off, specify an alt text for the notification message. This will be used when displaying the notification preview in your channel list.
  • Permission (required): Which Sendbird Organization roles should have access to this template.
  • Message retention (required): Specify how many days notification messages sent through this template should exist. Acceptable values are between 1 and 180. This feature provides teams with the capability to define how long notifications are retained, tailored to each template's specific needs. Adjustable on the Sendbird Dashboard, this ensures that messages are kept for a period that aligns with business requirements and operational strategies while keeping a user’s notification center clear of clutter.

Template editor

Copy link

In addition to the fields above, you’ll also need to create a visual representation of your notification using the Template Editor. This is used by the UIKits, Flutter Notification Widget and the Javascript Template Preview package to render the notification as designed. If you are not using any of the previously mentioned packages, the template design likely does not impact your implementation.

Inside of the Template editor, you’ll be able to customize each element of your template such as padding, font size, color, alignment and so forth. Some aspects of the template design will be controlled by the global theme.

  • Components: Includes Box, Text, Image, Text Button, and Image Button. Each serves specific roles in a notification design.
  • Container: The parent element that holds notification components.
  • Layout: Consists of the following two sections:
    • Box: Configures direction, distribution, alignment, padding, and margins.
    • Others (Text, Image, Text Button, Image Button): Configures padding and margins.
  • Color: Allows configuration of component colors, such as text color.
  • Action: Set actions within a notification, like routing to a specific screen in a mobile app.
  • Variables: Variables are an important aspect of building templates. They're the customizable parts of the template that you can change each time you send a notification. There are three different types of variables that Sendbird Notifications provides.

Variable typeDescription

String

Specifies the texts used in the body of the template and the text buttons. These texts are subject to change each time the notification is sent. The string variable is shown as a text field in the Sendbird Notification Builder. You can assign a value to the key of the variable before sending the notification.

Image

Specifies the images used in the template. These images are subject to change each time the notification is sent. The image variable is shown as an image URL field in the Sendbird Notification Builder. You can assign a value to the key of the variable before sending the notification.

Action

Specifies the actions to execute when a UI component in the template is tapped on the mobile app. These actions are subject to change each time the notification is sent. The action variable is shown as a drop-down menu containing two action types and a URL field in the Sendbird Notification Builder. You can assign two different types of action values to the variable key: Web link and In-app link.
- Web link: Directs the user to an external web URL when the component is tapped.
- In-app link: Directs the user to a different screen within the client app when the component is tapped.

To see how to set variables in a template using the API, refer to a guide on Send a notification Platform API.

Limitations

Copy link

Templates can be edited at any time to update their appearance and content though there are a few limitations to note:

  • Variables cannot be added, removed or edited once the template has been created.
  • The key cannot be changed.
  • Any changes that are made will only apply to notifications sent with the template after the changes. These changes are not retroactive.

Render messages with templates

Copy link

To see if your notification's been successfully sent, install Sendbird Chat UIKit for Notifications to render a notification channel in your app. Sendbird Notifications currently supports two mobile platforms: iOS and Android.