novu
novu copied to clipboard
🚀 Feature: Make an Endpoint for Handlebars Interpolation Using Existing Templates
🔖 Feature description
We have a panel where the admin can create different types of announcements. These announcements are tied to different workflows, and each of them have their own custom handlebars in app template. Some are cosmetically complex. It'd be nice to have an endpoint that we can just call to have the templating engine on novu backend do the interpolation and return the resulting html back. Something like this:
🎤 Why is this feature needed ?
Right now, we have to manually find the template by getting the entire detail of a workflow, then look for a specific step, extract out the handlebars template and then on our react admin panel, use the data input by the admin and interpolate using the handlebars package.
✌️ How do you aim to achieve this?
To have a new endpoint specifically for previewing things. A possible interface in the sdk might be:
novu.workflows.previewTemplate({
name: workflowName,
payload: {
announcementName,
announcementDescription,
},
step: 1,
});
The endpoint returns a string representing the interpolated content using the handlebars template and the given payload of the specified workflow and step.
🔄️ Additional Information
No response
👀 Have you spent some time to check if this feature request has been raised before?
- [X] I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Contributing Guidelines
Are you willing to submit PR?
Yes I am willing to submit a PR!