Leverage the digest functionality to send in-app notifications
digest node
to your workflow in the workflow editor in the Novu dashboard.
Let’s see it in action now!
Creating workflows is simple
create workflow
button, you’ll see a dropdown. Select blank workflow
from the dropdown:
Select `blank workflow` from the dropdown
Workflow editor allows you to create and edit workflows
In-App
channel. You’ll also
see the Digest
action on the right sidebar.digest
action below the trigger node
, and add the in-app
channel node below the digest
node as shown below:
Adding digest node
digest
node allows you to set a specific time interval for when notifications
should be sent:
Manipulating values in the digest node
in-app
channel as per your
need:
You can configure the in-app node as per your requirements
Values we're gonna use
update
button on
the top right. It’ll automatically create a trigger code that you can use in your
app. To get it, click on the get snippet
button on the top right and copy it:
Getting trigger code
novu.js
, in our case) and the trigger function is getting called in the controller function above by the name getDigest
.
If you’re following the guide, you’ve already copied the trigger function. But before we can add it to our app, we need one key thing - Subscribers.
Subscribers are entities to which the notifications are sent. You can see a list of subscribers in the Novu dashboard as well.
In our app, we’ll create a subscriber in Node.js as we’re writing our backend in Node.js, but we also have backend SDKs (Node.js, PHP, .NET, Go, Ruby, Python and Kotlin) to choose from. The recommended way to create a subscriber in NodeJS is as follows:
subscriberID
of aa234u787.
You can read more about subscribers here.
Back in our app, we can now add the trigger function:
applicationIdentifier
. You can get your application id
from the settings menu in the Novu dashboard.
Beyond this, we just need to call the API we had written above when the form is submitted with the data we want in the payload. The code to do so is as follows:
Filtering by channel