pis #12

Merged
fred.boniface merged 95 commits from pis into main 2023-05-06 21:54:51 +01:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 6bc25dc154 - Show all commits

View File

@ -34,7 +34,7 @@ async function generateKey() { // Needs testing & moving to 'register.utils'
async function generateConfirmationEmail(eml, uuid) { async function generateConfirmationEmail(eml, uuid) {
try { try {
let htmlTpl = await fs.readFile('mail-templates/register.html', 'utf-8'); let htmlTpl = await fs.readFile('mail-templates/register.html', 'utf-8');
let minify = await minify(((htmlTpl).replace(/>>ACCESSCODE<</g, uuid)), { let mini = minify(((htmlTpl).replace(/>>ACCESSCODE<</g, uuid)), { // Add collapse whitespace here
removeComments: true removeComments: true
}); });
let txtTpl = fs.readFile('mail-templates/register.txt', 'utf-8'); let txtTpl = fs.readFile('mail-templates/register.txt', 'utf-8');
@ -42,7 +42,7 @@ async function generateConfirmationEmail(eml, uuid) {
to: eml, to: eml,
subject: "OwlBoard Registration", subject: "OwlBoard Registration",
text: (await txtTpl).replace(/>>ACCESSCODE<</g, uuid), text: (await txtTpl).replace(/>>ACCESSCODE<</g, uuid),
html: minify html: mini
} }
} catch(err) { } catch(err) {
log.out(`mailServices.generateConfirmationEmail: Error reading templates, $(err)`, "err"); log.out(`mailServices.generateConfirmationEmail: Error reading templates, $(err)`, "err");