Learn how to use Novu to quickly send multi-channel (SMS, Email, Chat, Push) notifications with React.
The recipients of a triggered notification are called subscribers.The workflow includes the following:
Channel | Content Style | Custom Variables{{handlebars}} format |
---|---|---|
HTML | ✅ | |
Visual Editor | ✅ | |
SMS | Text | ✅ |
Chat | Text | ✅ |
In-App | Text | ✅ |
Push | Text | ✅ |
Select the in-app channel
Configure the in-app node as per your need
{{ }}
. This means you can inject variables from your code into a notification item’s text via a payload.We're gonna use custom variables here
Renaming the workflow to 'quickstart'
One subscriber is automatically created when you sign up
subscriberId
.
With Novu, you can create a subscriber using any of its SDKs (Node.js, PHP, .NET, Go, Ruby, Python and Kotlin). The NodeJS code to create a subscriber in Novu is:
identify
method used above either updates an existing subscriber using the payload data if a subscriber with the same subscriberId
already exists, or creates a new one if it doesn’t. Here, since no subscriber with firstName
of Sumit
and lastName
of Saurabh
exists, a new one was created and we can now send a notification to this subscriber by triggering a workflow.
identify
method in our
docs<NOVU_API_KEY>
with it. Now, head over to the Novu dashboard and see the newly created subscriber above with a subscriberId
of 789
.
You can also update information about an already existing subscriber using the subscriber.update
method as shown below:
applicationIdentifier
and subscriberID
.
An application identifier is a public key used to identify your application. You can get your own application identifier from the Novu dashboard settings.
And subscribers are users to whom notifications will be sent. They are identified by a subscriberID
which you can also find in the Novu subscribers dashboard.
quickstart
and send a notification to the subscriber with subscriberId
of 789
.
Make sure you’re executing this code with the correct credentials.