Prepare to move minification into separate module

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-04-18 21:47:27 +01:00
parent 6bc25dc154
commit 2606f89e95
3 changed files with 15 additions and 9 deletions

View File

@ -17,7 +17,7 @@
<table style="width:100%;text-align:center;color:azure;font-family:sans-serif;">
<tr>
<td>
<img src="https://owlboard.info/images/logo/wide_logo.svg" style="height: 100px; padding-top: 20px; margin-top: 0px">
<img src="https://owlboard.info/images/logo/wide_logo.svg" style="height:100px;padding-top:0px;margin-top:0px">
</td>
</tr>
<tr>

View File

@ -35,7 +35,8 @@ async function generateConfirmationEmail(eml, uuid) {
try {
let htmlTpl = await fs.readFile('mail-templates/register.html', 'utf-8');
let mini = minify(((htmlTpl).replace(/>>ACCESSCODE<</g, uuid)), { // Add collapse whitespace here
removeComments: true
removeComments: true,
collapseWhitespace: true
});
let txtTpl = fs.readFile('mail-templates/register.txt', 'utf-8');
return msg = {

View File

@ -0,0 +1,5 @@
const htmlShrink = require('html-minifier').minify
module.exports = async function minify(input) { // Do I need to name this function?
// Minify HTML input, including inline styles.
}