const data = {
name: 'my template',
organisationId: 'abc123',
environments: [
{
template: 'My email template {{custom:my-custom-tag}}',
formsAppEnvironmentId: 1,
},
],
type: 'FORM_SUBMISSION_EVENT_PDF',
}
const emailTemplate = await emailTemplates.createEmailTemplate(data)
// Use emailTemplate here...
The data for the new email template
The id of the email template
const searchParams = {
limit: 1,
offset: 0,
}
const { emailTemplates, meta } =
await emailTemplates.searchEmailTemplates(searchParams)
Search options
const data = {
id: 1,
name: 'my updated template',
organisationId: 'abc123',
environments: [
{
template: 'My email template {{custom:my-custom-tag}}',
formsAppEnvironmentId: 1,
},
],
type: 'FORM_SUBMISSION_EVENT_PDF',
}
const emailTemplate = await emailTemplates.updateEmailTemplate(data)
// Use emailTemplate here...
The data for the email template to update
Example