pis #12
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "owlboard",
|
"name": "owlboard",
|
||||||
"version": "0.0.1",
|
"version": "1.2.0-dev",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "owlboard",
|
"name": "owlboard",
|
||||||
"version": "0.0.1",
|
"version": "1.2.0-dev",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.2.1",
|
"axios": "^1.2.1",
|
||||||
|
@ -10,15 +10,16 @@
|
|||||||
},
|
},
|
||||||
"name": "owlboard",
|
"name": "owlboard",
|
||||||
"description": "OwlBoard is an API and PWA for live rail departure board in the UK.",
|
"description": "OwlBoard is an API and PWA for live rail departure board in the UK.",
|
||||||
"version": "0.0.1",
|
"version": "1.2.0-dev",
|
||||||
"main": "express.js",
|
"main": "express.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "node app.js"
|
"start": "node app.js",
|
||||||
|
"run": "node app.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.fjla.uk/fred.boniface/owlboard.git"
|
"url": "https://git.fjla.uk/owlboard/backend.git"
|
||||||
},
|
},
|
||||||
"author": "Fred Boniface",
|
"author": "Fred Boniface",
|
||||||
"license": "GPL-3.0-or-later"
|
"license": "GPL-3.0-or-later"
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
const testing = require('../services/mail.services')
|
||||||
|
const log = require('../utils/log.utils')
|
||||||
|
|
||||||
async function getAlive(){
|
async function getAlive(){
|
||||||
log.out(`kubeServices.getAlive: alive hook checked`, "info")
|
log.out(`kubeServices.getAlive: alive hook checked`, "info")
|
||||||
return {code: 200, state: {state: "alive",noise: "twit-twoo"}}
|
return {code: 200, state: {state: "alive",noise: "twit-twoo"}}
|
||||||
@ -5,6 +8,7 @@ async function getAlive(){
|
|||||||
|
|
||||||
async function getReady(){
|
async function getReady(){
|
||||||
log.out(`kubeServices.getReady: ready hook checked`, "info")
|
log.out(`kubeServices.getReady: ready hook checked`, "info")
|
||||||
|
testing.sendTest("fred@fjla.uk");
|
||||||
return "not_implemented";
|
return "not_implemented";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const log = require('../utils/log.utils')
|
const log = require('../utils/log.utils')
|
||||||
const fs = require('fs')
|
const fs = require('fs/promises')
|
||||||
const mail = require('nodemailer'); //>> Probs wrong
|
const mail = require('nodemailer'); //>> Probs wrong
|
||||||
|
|
||||||
const fromAdrr = process.env.OWL_EML_FROM
|
const fromAdrr = process.env.OWL_EML_FROM
|
||||||
@ -21,16 +21,25 @@ const options = {
|
|||||||
|
|
||||||
let transporter = mail.createTransport(options)
|
let transporter = mail.createTransport(options)
|
||||||
|
|
||||||
async function sendTest(to, subject, html) {
|
async function sendTest(to, cc, bcc) {
|
||||||
log.out(`mailServices.sendTest: Sending test message to: ${to}, subject: ${subject}`, "info")
|
log.out(`mailServices.sendTest: Sending test message to: ${to}`, "info")
|
||||||
|
let tHtml = fs.readFile('mail-templates/test.html', 'utf-8');
|
||||||
|
let tTxt = fs.readFile('mail-templates/test.txt', 'ascii')
|
||||||
// Send test mail message
|
// Send test mail message
|
||||||
let res = await transporter.sendMail({
|
try {
|
||||||
|
var res = await transporter.sendMail({
|
||||||
from: fromAdrr,
|
from: fromAdrr,
|
||||||
to: to,
|
to: to,
|
||||||
|
cc: cc,
|
||||||
|
bcc: bcc,
|
||||||
subject: "Test Message from OwlBoard",
|
subject: "Test Message from OwlBoard",
|
||||||
text: "OwlBoard Test Message - See HTML",
|
text: await tTxt,
|
||||||
html: html
|
html: await tHtml
|
||||||
});
|
});
|
||||||
|
} catch(err) {
|
||||||
|
log.out(err, "warn")
|
||||||
|
var res = "failed"
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user