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
|
||||
}
|
||||
34
lib/plugins/email/mailjet/schema.json
Normal file
34
lib/plugins/email/mailjet/schema.json
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"code": "mailjet",
|
||||
"display": "Mailjet",
|
||||
"fields": [
|
||||
{
|
||||
"code": "apiKey",
|
||||
"display": "API key",
|
||||
"fieldType": "string",
|
||||
"required": true,
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"code": "apiSecret",
|
||||
"display": "API secret",
|
||||
"fieldType": "password",
|
||||
"required": true,
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"code": "fromEmail",
|
||||
"display": "From email",
|
||||
"fieldType": "string",
|
||||
"required": true,
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"code": "toEmail",
|
||||
"display": "To email",
|
||||
"fieldType": "string",
|
||||
"required": true,
|
||||
"value": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue