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

@ -2,11 +2,14 @@
<head>
<title>OwlBoard - Register</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="key" content=">>ACCESSCODE<<" />
<style>
html {
text-align: center;
width: 100%;
margin: 0;
padding: 0;
background-color: #404c55;
background-image: radial-gradient(#2b343c, #404c55);
}
body {
margin: 0;
@ -26,6 +29,10 @@
background-color: #404c55;
background-image: radial-gradient(#2b343c, #404c55);
}
p {
margin-left: 40px;
margin-right: 40px;
}
#title {
height: 100px;
padding-top: 0px;
@ -44,16 +51,24 @@
text-decoration: none;
border-radius: 14px;
}
.digits {
color: azure;
font-size: xx-large;
font-weight: bolder;
letter-spacing: 0.75ch;
margin-left: 0.75ch;
}
</style>
</head>
<body>
<br /><br />
<br><br>
<table>
<tr>
<td>
<img
src="https://owlboard.info/images/logo/wide_logo.svg"
id="title"
alt="OwlBoard Logo"
/>
</td>
</tr>
@ -62,27 +77,25 @@
<h1>Register for OwlBoard</h1>
<br />
<p>
Tap the button to register this device, or scan the barcode with
another device.
You'll need to type your registration code in to the OwlBoard app
</p>
<br />
<h2>Your Code:</h2>
<span class="digits">987654</span>
<br><br>
<a
href="https://owlboard.info/more/reg/submit?key=>>ACCESSCODE<<"
href="https://owlboard.info/more/reg/submit"
id="button"
>Register this device</a
>Go to Registration Page</a
>
<br /><br /><br />
<p>Or scan with the device you want to register</p>
<br />
<p>Scan to visit the Registration Page</p>
<img
src="https://barcodes.fjla.uk/generate?type=qr&text=https%3A%2F%2Fowlboard.info%2Fmore%2Freg%2Fsubmit%3Fkey%3D>>ACCESSCODE<<"
alt="Scan barcode to register on another device"
src="https://barcodes.fjla.uk/generate?type=qr&text=https%3A%2F%2Fowlboard.info%2Fmore%2Freg%2Fsubmit"
alt="Scan barcode to register on another device, alternatively use the link above"
title="Scan to register on another device"
/>
<br /><br /><br />
<p>
Alternatively copy and paste the link:<br />https://owlboard.info/more/reg/submit?key=>>ACCESSCODE<<
</p>
<p>
This registration is for one device only, you can register again
using the same email address for other devices and access OwlBoard
@ -96,7 +109,7 @@
can safely ignore this email. Your email address has not been stored
by us.
</p>
<p>The registration link will expire after 4 hours.</p>
<p>The registration link will expire after 1 hour.</p>
</td>
</tr>
</table>

View File

@ -1,6 +1,6 @@
Complete your OwlBoard (Staff) Registration by entering your six digit code.
>>ACCESSCODE<<
987654
Use the same browser you wish to use OwlBoard with

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) {