Migrate plugins to lib directory
This commit is contained in:
parent
09b29bba56
commit
e7ab8223c2
27 changed files with 869 additions and 858 deletions
23
lib/plugins/email/mailjet/mailjet.js
Normal file
23
lib/plugins/email/mailjet/mailjet.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
const Mailjet = require('node-mailjet')
|
||||
|
||||
const NAME = 'Mailjet'
|
||||
|
||||
function sendMessage (account, rec) {
|
||||
const mailjet = Mailjet.connect(account.apiKey, account.apiSecret)
|
||||
const sendEmail = mailjet.post('send')
|
||||
|
||||
const emailData = {
|
||||
FromEmail: account.fromEmail,
|
||||
FromName: 'Lamassu Server',
|
||||
Subject: rec.email.subject,
|
||||
'Text-part': rec.email.body,
|
||||
Recipients: [{'Email': account.toEmail}]
|
||||
}
|
||||
|
||||
return sendEmail.request(emailData)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
NAME,
|
||||
sendMessage
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue