chore: server code formatting
This commit is contained in:
parent
aedabcbdee
commit
68517170e2
234 changed files with 9824 additions and 6195 deletions
|
|
@ -2,29 +2,29 @@ const Mailgun = require('mailgun-js')
|
|||
|
||||
const NAME = 'Mailgun'
|
||||
|
||||
function sendMessage ({apiKey, domain, fromEmail, toEmail}, rec) {
|
||||
const mailgun = Mailgun({apiKey, domain})
|
||||
function sendMessage({ apiKey, domain, fromEmail, toEmail }, rec) {
|
||||
const mailgun = Mailgun({ apiKey, domain })
|
||||
const to = rec.email.toEmail ?? toEmail
|
||||
|
||||
const emailData = {
|
||||
from: `Lamassu Server ${fromEmail}`,
|
||||
to,
|
||||
subject: rec.email.subject,
|
||||
text: rec.email.body
|
||||
text: rec.email.body,
|
||||
}
|
||||
|
||||
return mailgun.messages().send(emailData)
|
||||
}
|
||||
|
||||
function sendCustomerMessage ({apiKey, domain, fromEmail}, rec) {
|
||||
const mailgun = Mailgun({apiKey, domain})
|
||||
function sendCustomerMessage({ apiKey, domain, fromEmail }, rec) {
|
||||
const mailgun = Mailgun({ apiKey, domain })
|
||||
const to = rec.email.toEmail
|
||||
|
||||
const emailData = {
|
||||
from: fromEmail,
|
||||
to,
|
||||
subject: rec.email.subject,
|
||||
text: rec.email.body
|
||||
text: rec.email.body,
|
||||
}
|
||||
|
||||
return mailgun.messages().send(emailData)
|
||||
|
|
@ -33,5 +33,5 @@ function sendCustomerMessage ({apiKey, domain, fromEmail}, rec) {
|
|||
module.exports = {
|
||||
NAME,
|
||||
sendMessage,
|
||||
sendCustomerMessage
|
||||
sendCustomerMessage,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue