Continued email testing

This commit is contained in:
Fred Boniface 2023-04-04 11:45:32 +01:00
parent 184b7e50c3
commit f03f02ede9
4 changed files with 63 additions and 21 deletions

View File

@ -1,23 +1,30 @@
<html lang="en" style="background-color: grey; width: 100%;"> <html lang="en" style="background-color: grey; width: 100%;">
<head> <head>
<title>OwlBoard - Register</title> <title>OwlBoard - Register</title>
<style>
html {
background-color: #2b343c;
}
</style>
</head> </head>
<body> <body>
<table width="100%"> <table style="width: 100%; text-align: center; color: white">
<tr> <tr>
<td> <td>
<img src="https://owlboard.info/images/logo/wide_logo.svg" style="height: 100px"> <img src="https://owlboard.info/images/logo/wide_logo.svg" style="height: 100px">
</td> </td>
<td> </tr>
<h1>Register for OwlBoard</h1> <tr>
<p>Use the link below to register for OwlBoard (Staff Version)</p> <td>
<a href="">Register</a> <h1 style="color: #00b7b7">Register for OwlBoard</h1>
<br> <p>Use the link below to register for OwlBoard (Staff Version)</p>
<p>The registration will apply only to the device you click this link on, <a href="" style="color: white;">Register</a>
you can use the same email to register on other devices but you will <br>
need a separate registration link. <p>The registration will apply only to the device you click this link on,
</p> you can use the same email address to register on other devices but you will
</td> need a separate registration link.
</p>
</td>
</tr> </tr>
</table> </table>
</body> </body>

View File

@ -0,0 +1,28 @@
<html lang="en" style="background-color: grey; width: 100%;">
<head>
<title>OwlBoard - Register</title>
<style>
html {
background-color: #2b343c;
}
</style>
</head>
<body>
<table style="width: 100%; text-align: center; color: white">
<tr>
<td>
<img src="https://owlboard.info/images/logo/wide_logo.svg" style="height: 100px">
</td>
</tr>
<tr>
<td>
<h1 style="color: #00b7b7">Testing OwlBoard</h1>
<p>This is a test message from OwlBoard (Testing version)</p>
<a href="" style="color: white;">Not a Link</a>
<br>
<p>There is nothing important here</p>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,7 @@
OwlBoard
This is a test message from OwlBoard
It can safely be disregarded, apologies if it has reached you by mistake
OwlBoard does not store any email addresses so any mistake has been caused by manual entry.

View File

@ -1,18 +1,18 @@
const log = require('../utils/log.utils') const log = require('../utils/log.utils')
const fs = require('fs') const fs = require('fs')
const mail = require('node-mailer'); //>> Probs wrong const mail = require('nodemailer'); //>> Probs wrong
const fromAdrr = process.env.OWL_EML_FROM const fromAdrr = process.env.OWL_EML_FROM
const smtpUser = process.env.OWL_EML_USER const smtpUser = process.env.OWL_EML_USER
const smtpPass = process.env.OWL_EML_PASS const smtpPass = process.env.OWL_EML_PASS
const smtpHost = process.env.OWL_EML_HOST const smtpHost = process.env.OWL_EML_HOST
const smtpPort = process.env.OWL_EML_PORT const smtpPort = process.env.OWL_EML_PORT
// The 'secure' option is not optional to ensure it is not accidentally omitted // The 'secure' option is set to false as the SMTP server used only supports STARTTLS and will not accept TLS or no encryption
const options = { const options = {
host: smtpHost, host: smtpHost,
port: smtpPort, port: smtpPort,
secure: true, secure: false,
auth: { auth: {
user: smtpUser, user: smtpUser,
pass: smtpPass pass: smtpPass
@ -21,17 +21,17 @@ const options = {
let transporter = mail.createTransport(options) let transporter = mail.createTransport(options)
async function sendTest(to, subject, plaintext, html) { async function sendTest(to, subject, html) {
log.out(`mailServices.sendTest: Sending test message to: ${to}, subject: ${subject}`, "info") log.out(`mailServices.sendTest: Sending test message to: ${to}, subject: ${subject}`, "info")
// Send test mail message // Send test mail message
let res = await transporter.sendMail({ let res = await transporter.sendMail({
from: fromAdrr, from: fromAdrr,
to: to, to: to,
subject: subject, subject: "Test Message from OwlBoard",
text: plaintext, text: "OwlBoard Test Message - See HTML",
html: html html: html
}); });
return; return res;
} }
async function sendRegister() { async function sendRegister() {