Created
October 19, 2019 09:46
-
-
Save alexandermckay/cf45caf7f39a94f2d9864ab47aa4b285 to your computer and use it in GitHub Desktop.
dynamic-content.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mailOptions = ({ subject, name, message }) => { | |
const text = ` | |
Name: ${name} | |
Message: ${message} | |
`; | |
const html = ` | |
<h1>Name: ${name}</h1> | |
<p>Message: ${message}</p> | |
`; | |
return { | |
from: sender, | |
to: recipient, | |
subject, | |
text, | |
html, | |
}; | |
}; | |
const handleEmail = (req, res) => { | |
transporter.sendMail(mailOptions(req.query), transport); | |
res.send({ status: 200 }); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment