Continued email testing
This commit is contained in:
parent
184b7e50c3
commit
f03f02ede9
@ -1,23 +1,30 @@
|
||||
<html lang="en" style="background-color: grey; width: 100%;">
|
||||
<head>
|
||||
<title>OwlBoard - Register</title>
|
||||
<style>
|
||||
html {
|
||||
background-color: #2b343c;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%">
|
||||
<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>
|
||||
<td>
|
||||
<h1>Register for OwlBoard</h1>
|
||||
<p>Use the link below to register for OwlBoard (Staff Version)</p>
|
||||
<a href="">Register</a>
|
||||
<br>
|
||||
<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
|
||||
need a separate registration link.
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<img src="https://owlboard.info/images/logo/wide_logo.svg" style="height: 100px">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h1 style="color: #00b7b7">Register for OwlBoard</h1>
|
||||
<p>Use the link below to register for OwlBoard (Staff Version)</p>
|
||||
<a href="" style="color: white;">Register</a>
|
||||
<br>
|
||||
<p>The registration will apply only to the device you click this link on,
|
||||
you can use the same email address to register on other devices but you will
|
||||
need a separate registration link.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
28
src/mail-templates/test.html
Normal file
28
src/mail-templates/test.html
Normal 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>
|
7
src/mail-templates/test.txt
Normal file
7
src/mail-templates/test.txt
Normal 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.
|
@ -1,18 +1,18 @@
|
||||
const log = require('../utils/log.utils')
|
||||
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 smtpUser = process.env.OWL_EML_USER
|
||||
const smtpPass = process.env.OWL_EML_PASS
|
||||
const smtpHost = process.env.OWL_EML_HOST
|
||||
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 = {
|
||||
host: smtpHost,
|
||||
port: smtpPort,
|
||||
secure: true,
|
||||
secure: false,
|
||||
auth: {
|
||||
user: smtpUser,
|
||||
pass: smtpPass
|
||||
@ -21,17 +21,17 @@ const 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")
|
||||
// Send test mail message
|
||||
let res = await transporter.sendMail({
|
||||
from: fromAdrr,
|
||||
to: to,
|
||||
subject: subject,
|
||||
text: plaintext,
|
||||
subject: "Test Message from OwlBoard",
|
||||
text: "OwlBoard Test Message - See HTML",
|
||||
html: html
|
||||
});
|
||||
return;
|
||||
return res;
|
||||
}
|
||||
|
||||
async function sendRegister() {
|
||||
|
Loading…
Reference in New Issue
Block a user