Minor random updates
This commit is contained in:
15
sendemail.js
15
sendemail.js
@@ -7,12 +7,12 @@ var transporter = nodemailer.createTransport({
|
||||
secure: true, // upgrade later with STARTTLS
|
||||
auth: {
|
||||
user: process.env.email_api,
|
||||
pass: process.env.email_secret
|
||||
}
|
||||
pass: process.env.email_secret,
|
||||
},
|
||||
});
|
||||
|
||||
// verify connection configuration
|
||||
transporter.verify(function(error, success) {
|
||||
transporter.verify(function (error, success) {
|
||||
if (error) {
|
||||
console.log(error);
|
||||
} else {
|
||||
@@ -22,17 +22,18 @@ transporter.verify(function(error, success) {
|
||||
|
||||
exports.sendEmail = (req, res) => {
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
console.log("[EMAIL] Incoming Message Body", req.body);
|
||||
//console.log("[EMAIL] Incoming Message Body", req.body);
|
||||
console.log("[EMAIL] Incoming Message", req.body.from.name);
|
||||
}
|
||||
transporter.sendMail(
|
||||
{
|
||||
...req.body,
|
||||
from: {
|
||||
name: req.body.from.name || "No Reply @ Bodyshop.app",
|
||||
address: "noreply@bodyshop.app"
|
||||
}
|
||||
address: "noreply@bodyshop.app",
|
||||
},
|
||||
},
|
||||
function(error, info) {
|
||||
function (error, info) {
|
||||
if (error) {
|
||||
console.log("[EMAIL] Email send failed. ", error);
|
||||
res.json({ success: false, error: error });
|
||||
|
||||
Reference in New Issue
Block a user