Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: Make an Endpoint for Handlebars Interpolation Using Existing Templates #4962

Open
2 tasks done
Khongchai opened this issue Dec 10, 2023 · 0 comments
Open
2 tasks done
Labels

Comments

@Khongchai
Copy link
Contributor

🔖 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?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

@jainpawan21 jainpawan21 added linear and removed linear labels Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants