Create a notification template in your app's dashboard to specify the standard text, placeholders, and recipients of notifications. You can then call the Notify endpoint from your code to trigger sending notifications based on the template you defined.
In your Wix Studio Workspace, select an app from the Custom Apps page .
In your app's dashboard, click Extensions to open the Extensions page.
Click Create Extension.
Search for the Notification extension and click Create. This opens the form for defining a new notification template.
Fill out the notification template creation form to define a new notification template and click Save to enable it. The form includes the following sections:
Give your notification template an internal name and description for managing it in your app's dashboard. These are only visible to you.
Choose a name and description that make clear what the notification is about and who receives it. For example, you might choose a name like "New reservation" and a description like "Sent to the site owner when a customer makes a new reservation."
Here you can also find the Notification template ID. You need this ID to identify your notification template in API calls.
Define who receives notifications of this type and where they receive them:
Create the notification content.
If you enable notifications to the mobile app in the Recipients section, a Title field appears here. Enter a notification title that recipients will see.
In the Message field, enter the text of your notification.
The message and the title can include placeholders for dynamic values you provide each time you send an HTTP request to trigger notifications. For example:
Title: Item delivered: {{itemType}}.
Message: {{customerName}} has received a {{itemType}} delivery.
When triggering a notification with the Notify endpoint in your code, pass values for itemType
and customerName
, so a recipient sees a customized notification like this:
Title: Item delivered: television.
Message: Sally Jones has received a television delivery.
Remember your notification template ID and the names of placeholders for dynamic values in your message and title, as you'll need them to invoke the API and trigger notifications.
You can always return to Extensions page in your app's dashboard to find these details.
Click Save to generate your notification template. You can now trigger notifications with the Notify endpoint.