feat: mock-email and some fixes for email auth
This commit is contained in:
parent
ab304093f3
commit
c173f241eb
10 changed files with 97 additions and 26 deletions
15
lib/email.js
15
lib/email.js
|
|
@ -3,7 +3,7 @@ const ph = require('./plugin-helper')
|
|||
function sendMessage (settings, rec) {
|
||||
return Promise.resolve()
|
||||
.then(() => {
|
||||
const pluginCode = 'mailgun'
|
||||
const pluginCode = settings.config.notifications_thirdParty_email
|
||||
const plugin = ph.load(ph.EMAIL, pluginCode)
|
||||
const account = settings.accounts[pluginCode]
|
||||
|
||||
|
|
@ -11,4 +11,15 @@ function sendMessage (settings, rec) {
|
|||
})
|
||||
}
|
||||
|
||||
module.exports = {sendMessage}
|
||||
function sendCustomerMessage (settings, rec) {
|
||||
return Promise.resolve()
|
||||
.then(() => {
|
||||
const pluginCode = settings.config.notifications_thirdParty_email
|
||||
const plugin = ph.load(ph.EMAIL, pluginCode)
|
||||
const account = settings.accounts[pluginCode]
|
||||
|
||||
return plugin.sendMessage(account, rec)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {sendMessage, sendCustomerMessage}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue