Initial commit

This commit is contained in:
2026-04-17 23:26:01 +00:00
commit 2ea4ca5d52
409 changed files with 63459 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
const renderMailTemplate = (e, type) => {
try {
const language = e.record?.getString('language') ?? 'en'
const locale = require(`${__hooks}/locales/${language}.json`)
const subject = $template.loadString(
locale.mailSubject[type]
).render({
...e.meta,
...e.app.settings().meta
})
const html = $template.loadFiles(
`${__hooks}/templates/${language}/${type}.html`
).render({
...e.meta,
...e.app.settings().meta
})
e.message.subject = subject
e.message.html = html
} catch (error) {
console.log(error)
}
e.next()
}
module.exports = { renderMailTemplate }