Adjust mail templates for registration code

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface
2024-03-09 19:31:59 +00:00
parent 70c9aa2b1e
commit 5904ee37cd
3 changed files with 30 additions and 17 deletions

View File

@@ -47,13 +47,13 @@ export function generateCode(): string {
async function generateConfirmationEmail(eml: string, uuid: string) {
try {
const htmlTpl = await fs.readFile("mail-templates/register.html", "utf-8");
const htmlStr = htmlTpl.replace(/>>ACCESSCODE<</g, uuid);
const htmlStr = htmlTpl.replace(/987654/g, uuid);
const htmlMin = await minifyMail(htmlStr);
const txtTpl = fs.readFile("mail-templates/register.txt", "utf-8");
return {
to: eml,
subject: "OwlBoard Registration",
text: (await txtTpl).replace(/>>ACCESSCODE<</g, uuid),
text: (await txtTpl).replace(/987654/g, uuid),
html: htmlMin,
};
} catch (err) {