TL;DR: All you need to know about the latest Novu 0.20.0 release. Global User Preferences, Integrations conditions, Digest and delay filters, and more!
0.20 Release Updates
We're thrilled to announce the newest features in our most recent release. Let's get started and explore what's waiting for you!
Global Channel Preferences for Subscribers API
It's now possible to set subscriber preferences globally for either a particular channel or all channels via API.
I'm really stoked about this because before now it was only available per workflow, /:subscriberId/preferences/:templateId
With these API URLs, you can fetch and update global subscriber preferences.
-
PATCH /subscribers/:subscriberid/preference
- Update a subscriber preference globally. -
GET /subscribers/:subscriberid/preferences/global
- Fetch a subscriber preference globally.
Note: These methods are also available in the NodeJS SDK. They will be available in other language SDKs very soon.
If you're using the Headless service and Notification Center Widgets, you can set or fetch via the following APIs:
-
widgets/preferences
- PATCH : Update subscriber preferences globally
{
"enabled": true,
"preferences": [
{
"type": "in_app",
"enabled": true
},
{
"type": "email",
"enabled": false
}
]
}
-
widgets/preferences/global
- GET : Fetch subscriber preferences globally.
The exposed methods from the widgets are:
fetchUserGlobalPrereferences
updateUserGlobalPreferences
Note: If a workflow is marked as critical, the subscriber global preferences will be ignored, and notifications will be sent.
Filters Usage in Digest and Delay Nodes
Users can now add filters to the digest and delay nodes inside the workflow editor to dynamically control if a digest should be used or not.
Digest Node: Adding filter
Delay Node: Adding filter
Improved Error Messages In The Workflow Editor
We have improved the error icons and states for each node in the workflow, when no provider is connected or not configured.
SMS & Email Custom Data Overrides
We now support adding custom data in email overrides as shown below:
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
await novu.subscribers.trigger("workflowIdentifier", {
to: "subscriberId",
payload: {
customKey: "customValue",
},
overrides: {
email: {
from: "support@novu.co",
// customData will work only for sendgrid
customData: {
"customKey": "customValue"
}
}
}
}
Email Custom Data overrides
Note: This works for Sendgrid only at the moment.
You can override sms values via the code below.
...
...
await novu.subscribers.trigger("workflowIdentifier", {
to: "subscriberId",
payload: {
customKey: "customValue",
},
overrides: {
sms: {
to: "<insert-phone-number>",
content: "<insert-content>"
}
}
}
SMS Overrides
Enabling The Addition of Conditions to Integrations
Users can now create conditions for the channel integrations to be executed for specific tenants only.
In the image above, you can add the condition (to an integration) to state that the integration should be used if the tenant identifier used in trigger matches the tenant identifier set here.
Note: The integrations are the provider instances on the Integration store dashboard.
When Novu runs a trigger code with a tenant Identifier attached to it like so:
import { Novu } from '@novu/node';
const novu = new Novu(process.env.NOVU_API_KEY);
await novu.trigger('<WORKFLOW_TRIGGER_ID>',
{
to: {
subscriberId: '<UNIQUE_SUBSCRIBER_IDENTIFIER>',
email: 'john@doemail.com',
},
tenant: "tenantIdentifier"
}
);
..Novu runs checks on the integrations in the Integration store to determine which integration matches to be used to send the notification based on any condition that has been set. If nothing was set, it defaults to the primary provider set for the channel used in the workflow.
Mailtrap Email Provider Integration
Now, you can use the Mailtrap Email provider on Novu.
Clicksend SMS Provider Integration
Now, you can use the Clicksend SMS provider on Novu.
Full Changelog: https://github.com/novuhq/novu/compare/v0.19.0...v0.20.0
Top comments (0)