Compare commits
No commits in common. "79d3ff2d9cd643f02105256a7eb081ece6c67c58" and "f03f02ede9b39c04530e211bd0df270f5e2717ea" have entirely different histories.
79d3ff2d9c
...
f03f02ede9
|
@ -1,44 +0,0 @@
|
|||
<html lang="en" style="background-color: grey; width: 100%;">
|
||||
<head>
|
||||
<title>OwlBoard - Register</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
html {
|
||||
background-color: #404c55;
|
||||
background-image: radial-gradient(#2b343c,#404c55);
|
||||
}
|
||||
a {
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<br><br>
|
||||
<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">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h1 style="color: #00b7b7">Register for OwlBoard</h1>
|
||||
<br>
|
||||
<p>Use the link below to register for OwlBoard (Staff Version)</p>
|
||||
<br>
|
||||
<a href="https://owlboard.info/reg/auto.html?>>ACCESSCODE<<" style="color: azure; font-size: larger; background-color: #007979; padding: 8px; padding-left: 12px; padding-right: 12px; text-decoration: none; border-radius: 14px;">Register</a>
|
||||
<br><br><br>
|
||||
<p>Alternatively visit <a href="https://owlboard.info/reg">owlboard.info/reg</a> and paste in your access code:</p>
|
||||
<p>>>ACCESSCODE<<</p>
|
||||
<p>This registration is for one device only, you can register again using the
|
||||
same email address for other devices and access OwlBoard from both.
|
||||
</p>
|
||||
<p>If you did not request to sign up to OwlBoard (Staff Version), you can
|
||||
safely ignore this email.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
</body>
|
||||
</html>
|
|
@ -1,6 +0,0 @@
|
|||
Complete your OwlBoard (Staff) Registration using the link below.
|
||||
|
||||
https://owlboard.info/ref/auto.html?>>ACCESSCODE<<
|
||||
|
||||
Alternatively visit https://owlboard.info/ref/ and paste in your access code:
|
||||
>>ACCESSCODE<<
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "owlboard",
|
||||
"version": "1.2.0-dev",
|
||||
"version": "0.0.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "owlboard",
|
||||
"version": "1.2.0-dev",
|
||||
"version": "0.0.1",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"axios": "^1.2.1",
|
||||
|
|
|
@ -10,16 +10,15 @@
|
|||
},
|
||||
"name": "owlboard",
|
||||
"description": "OwlBoard is an API and PWA for live rail departure board in the UK.",
|
||||
"version": "1.2.0-dev",
|
||||
"version": "0.0.1",
|
||||
"main": "express.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node app.js",
|
||||
"run": "node app.js"
|
||||
"start": "node app.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.fjla.uk/owlboard/backend.git"
|
||||
"url": "https://git.fjla.uk/fred.boniface/owlboard.git"
|
||||
},
|
||||
"author": "Fred Boniface",
|
||||
"license": "GPL-3.0-or-later"
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<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">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>
|
||||
</html>
|
|
@ -1,6 +1,3 @@
|
|||
const testing = require('../services/mail.services')
|
||||
const log = require('../utils/log.utils')
|
||||
|
||||
async function getAlive(){
|
||||
log.out(`kubeServices.getAlive: alive hook checked`, "info")
|
||||
return {code: 200, state: {state: "alive",noise: "twit-twoo"}}
|
||||
|
@ -8,7 +5,6 @@ async function getAlive(){
|
|||
|
||||
async function getReady(){
|
||||
log.out(`kubeServices.getReady: ready hook checked`, "info")
|
||||
testing.sendTest("fred@fjla.uk");
|
||||
return "not_implemented";
|
||||
};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const log = require('../utils/log.utils')
|
||||
const fs = require('fs/promises')
|
||||
const fs = require('fs')
|
||||
const mail = require('nodemailer'); //>> Probs wrong
|
||||
|
||||
const fromAdrr = process.env.OWL_EML_FROM
|
||||
|
@ -7,60 +7,35 @@ 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 set to false as the SMTP server used only supports STARTTLS and will not accept TLS or no encryption
|
||||
|
||||
let transporter = mail.createTransport({
|
||||
const options = {
|
||||
host: smtpHost,
|
||||
port: smtpPort,
|
||||
secure: false, // Must be false for STARTTLS on port 587
|
||||
secure: false,
|
||||
auth: {
|
||||
user: smtpUser,
|
||||
pass: smtpPass
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function sendTest(to, cc, bcc) {
|
||||
log.out(`mailServices.sendTest: Sending test message to: ${to}`, "info")
|
||||
let tHtml = fs.readFile('mail-templates/register.html', 'utf-8');
|
||||
let tTxt = fs.readFile('mail-templates/register.txt', 'utf-8');
|
||||
let transporter = mail.createTransport(options)
|
||||
|
||||
async function sendTest(to, subject, html) {
|
||||
log.out(`mailServices.sendTest: Sending test message to: ${to}, subject: ${subject}`, "info")
|
||||
// Send test mail message
|
||||
try {
|
||||
var res = await transporter.sendMail({
|
||||
let res = await transporter.sendMail({
|
||||
from: fromAdrr,
|
||||
to: to,
|
||||
cc: cc,
|
||||
bcc: bcc,
|
||||
subject: "Test Message from OwlBoard",
|
||||
text: (await tTxt).replace(/>>ACCESSCODE<</g, "TEST-MESSAGE-ONLY"),
|
||||
html: (await tHtml).replace(/>>ACCESSCODE<</g, "TEST-MESSAGE-ONLY")
|
||||
text: "OwlBoard Test Message - See HTML",
|
||||
html: html
|
||||
});
|
||||
} catch(err) {
|
||||
log.out(err, "warn")
|
||||
var res = "failed"
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
async function sendRegister(to, accesscode) {
|
||||
log.out(`mailServices.sendRegister: Sending registration message to: ${to}`, "info")
|
||||
let tHtml = fs.readFile('mail-templates/register.html', 'utf-8');
|
||||
let tTxt = fs.readFile('mail-templates/register.txt', 'utf-8');
|
||||
// Send test mail message
|
||||
try {
|
||||
var res = transporter.sendMail({
|
||||
from: fromAdrr,
|
||||
to: to,
|
||||
cc: cc,
|
||||
bcc: bcc,
|
||||
subject: "OwlBoard - Complete Registration",
|
||||
text: (await tTxt).replace(/>>ACCESSCODE<</g, accesscode),
|
||||
html: (await tHtml).replace(/>>ACCESSCODE<</g, accesscode)
|
||||
});
|
||||
return await res;
|
||||
} catch(err) {
|
||||
log.out("mailServices.sendRegister: Mail send failed")
|
||||
log.out(err, "warn")
|
||||
return "failed"
|
||||
}
|
||||
async function sendRegister() {
|
||||
return;
|
||||
}
|
||||
|
||||
async function sendAlert() {
|
||||
|
|
Loading…
Reference in New Issue