2022-01-24 13:37:22 +01:00
|
|
|
export const buildTemplateEndpoints = API => ({
|
|
|
|
/**
|
|
|
|
* Gets the list of email template definitions.
|
|
|
|
*/
|
|
|
|
getEmailTemplateDefinitions: async () => {
|
|
|
|
return await API.get({ url: "/api/global/template/definitions" })
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the list of email templates.
|
|
|
|
*/
|
|
|
|
getEmailTemplates: async () => {
|
|
|
|
return await API.get({ url: "/api/global/template/email" })
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Saves an email template.
|
|
|
|
* @param template the template to save
|
|
|
|
*/
|
|
|
|
saveEmailTemplate: async template => {
|
|
|
|
return await API.post({
|
|
|
|
url: "/api/global/template",
|
2022-01-25 09:04:56 +01:00
|
|
|
body: template,
|
2022-01-24 13:37:22 +01:00
|
|
|
})
|
|
|
|
},
|
2022-01-24 15:32:27 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a list of app templates.
|
|
|
|
*/
|
|
|
|
getAppTemplates: async () => {
|
|
|
|
return await API.get({
|
2022-05-18 17:21:17 +02:00
|
|
|
url: "/api/templates",
|
2022-01-24 15:32:27 +01:00
|
|
|
})
|
|
|
|
},
|
2022-01-24 13:37:22 +01:00
|
|
|
})
|