diff --git a/src/mail-templates/register.html b/src/mail-templates/register.html index 80384e7..72a2425 100644 --- a/src/mail-templates/register.html +++ b/src/mail-templates/register.html @@ -1,23 +1,30 @@ OwlBoard - Register + - +
- - + + + +
- - -

Register for OwlBoard

-

Use the link below to register for OwlBoard (Staff Version)

- Register -
-

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. -

-
+ +
+

Register for OwlBoard

+

Use the link below to register for OwlBoard (Staff Version)

+ Register +
+

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. +

+
diff --git a/src/mail-templates/test.html b/src/mail-templates/test.html new file mode 100644 index 0000000..0473daa --- /dev/null +++ b/src/mail-templates/test.html @@ -0,0 +1,28 @@ + + + OwlBoard - Register + + + + + + + + + + +
+ +
+

Testing OwlBoard

+

This is a test message from OwlBoard (Testing version)

+ Not a Link +
+

There is nothing important here

+
+ + \ No newline at end of file diff --git a/src/mail-templates/test.txt b/src/mail-templates/test.txt new file mode 100644 index 0000000..9d5d6be --- /dev/null +++ b/src/mail-templates/test.txt @@ -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. \ No newline at end of file diff --git a/src/services/mail.services.js b/src/services/mail.services.js index eeb7e1f..b2d72e6 100644 --- a/src/services/mail.services.js +++ b/src/services/mail.services.js @@ -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() {