API endpoint to create an email template and associate it with the notification template
I was looking at the API documentation and couldn't find an API to create an email template. There is an API to create notification template and we can specify steps in the payload. The steps array has a placeholder for template object but not sure what is the format of it.
I see that we can create layout and associate a step to the layout in the UI but not sure how we can do it using API.
I have an email template in HTML that I wanted to use to trigger an email notification. Can someone please let me know the list of API calls required to create the template using the HTML content.
3 Replies
Something like this structure
For the layout , you should use the layout creation api call https://docs.novu.co/api/layout-creation/
and then you could use the layout id you get in the response either in the create notification->steps->template inside layoutId
Or use the update notification template to update the layoutId for a step
You could look at some examples in our tests like: https://github.com/novuhq/novu/blob/8eeb340982b1e4abb363f7b4643bb479c7088739/apps/api/src/app/notification-template/e2e/create-notification-templates.e2e.ts
https://github.com/novuhq/novu/blob/7e689da12e248b9fa4cb73611e0fbbd597692bce/apps/api/src/app/notification-template/e2e/update-notification-template.e2e.ts
@Ujwal Let me know how it goes 🙂
Hi @Ujwal
do you need more help in this?
@galiainouz Thanks for your help. That worked!
@Pawan Jain Hi Pawan. I'm good, don't need anymore help on this.