Notifications instantly alert site builders with important updates and information that helps them manage their businesses. You can use Wix’s notification extensions to handle your app’s notifications. When you send your notifications via Wix, site contributors get all their notifications in the same way they are accustomed to get Wix’s notifications.
To extend Wix functionality to include notifications, you add 2 notification extensions: a notification topic extension and a notification extension, and work with the Notifications API.
Once you’ve set up the relevant extensions, you can send customizable notifications to site contributors with ease.
Topics group notifications into types that make it simple for users to decide which types of notifications they want to receive. All of the notifications you create should be assigned to a topic (for example, “New Purchases”) under a relevant section (typically your app’s name).
Note: Notification topics can be created for site contributor notifications, and for site visitor notifications (contacts and members), but currently your app can only send site contributor notifications.
To create a new topic:
Go to Extensions in your app's dashboard and click + Create Extension.
Filter for Notifications, select Notification Topic, and then click + Create.
Enter a Section Name that your notification topic will be displayed under - typically your app’s name. All your app’s notification topics will be displayed under this section name.
Enter a group (meaning: topic) name for your notification that your users will subscribe to, such as “New purchases.”
Add a Description (this is visible only to you).
Skip assigning a type to your topic. These types are only relevant for notifications to site visitors, which are currently not available to apps. Therefore, this assignment won’t affect your notifications at all.
Set the default state. This determines whether this topic is toggled on or off by default when new users first install your app.
Now that you’ve created a notification topic, you’re ready to create a notification extension.
Notification extensions are templates that store your base notification data so that you can quickly and easily trigger a notification for a predefined topic. You can customize individual notifications by including dynamic values (placeholders that you can replace with customized text when sending notifications) in the template.
To create a new template:
Go to Extensions in your app's dashboard and click + Create Extension.
Filter for Notifications,select Notification, and click Create.
Choose a Notification name (visible only to you).
Add a Description (visible only to you).
Assign this notification to a topic. If you haven’t already created a topic, click + Create Notification Topic to create one.
Copy the Notification Template ID. You’ll send this auto-generated ID as a parameter in the Notify API call, to identify the notification you want to send. Note that this ID is only valid once you click Save.
Choose which site contributors get the notification:
Choose where users see the notification:
Define the notification’s message content. For example, "You have a new order". Follow these guidelines:
Once your changes are saved, an example of the HTTP request that enables you to trigger the notification will be displayed.
Note: 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. But don't worry if you forget them. You can always return to your app's dashboard to look these details up.
Configure your app to invoke Wix’s Notify API call whenever the relevant trigger is fired, passing the relevant notification template ID and all the dynamic values you included in the template to the call.
Once you’ve set up your app to handle all your expected flows, it’s important to test that your notifications are sent as expected. To do so, you’ll need to: