Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-04-18 21:21:09 +01:00
parent ca690c7a7e
commit 6bc25dc154
1 changed files with 2 additions and 2 deletions

View File

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