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
|
|
@ -16,7 +16,22 @@ function sendMessage ({apiKey, domain, fromEmail, toEmail}, rec) {
|
|||
return mailgun.messages().send(emailData)
|
||||
}
|
||||
|
||||
function sendCustomerMessage ({apiKey, domain, fromEmail}, rec) {
|
||||
const mailgun = Mailgun({apiKey, domain})
|
||||
const to = req.email.toEmail
|
||||
|
||||
const emailData = {
|
||||
from: fromEmail,
|
||||
to,
|
||||
subject: rec.email.subject,
|
||||
text: rec.email.body
|
||||
}
|
||||
|
||||
return mailgun.messages().send(emailData)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
NAME,
|
||||
sendMessage
|
||||
sendMessage,
|
||||
sendCustomerMessage
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue