Add job queue; e-mail sending; password reset support

This commit is contained in:
garrettmills
2020-05-25 15:45:26 -05:00
parent f371310620
commit 76ba843348
22 changed files with 884 additions and 30 deletions

29
app/unit/SMTPUnit.js Normal file
View File

@@ -0,0 +1,29 @@
const { Unit } = require('libflitter')
const nodemailer = require('nodemailer')
class SMTPUnit extends Unit {
static get name() { return 'smtp' }
static get services() {
return [...super.services, 'configs']
}
config() {
return this.configs.get('smtp')
}
transport() {
return this._transport
}
async go(app) {
const config = this.config()
this._transport = nodemailer.createTransport({
host: config.host,
port: config.port,
secure: config.secure,
auth: config.auth,
})
}
}
module.exports = exports = SMTPUnit