pis #12

Merged
fred.boniface merged 95 commits from pis into main 2023-05-06 21:54:51 +01:00
4 changed files with 63 additions and 21 deletions
Showing only changes of commit f03f02ede9 - Show all commits

View File

@ -1,20 +1,27 @@
<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>
</tr>
<tr>
<td> <td>
<h1>Register for OwlBoard</h1> <h1 style="color: #00b7b7">Register for OwlBoard</h1>
<p>Use the link below to register for OwlBoard (Staff Version)</p> <p>Use the link below to register for OwlBoard (Staff Version)</p>
<a href="">Register</a> <a href="" style="color: white;">Register</a>
<br> <br>
<p>The registration will apply only to the device you click this link on, <p>The registration will apply only to the device you click this link on,
you can use the same email to register on other devices but you will you can use the same email address to register on other devices but you will
need a separate registration link. need a separate registration link.
</p> </p>
</td> </td>

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