Removed some logging, reformatted
parent
1826ac49c0
commit
965d8a1438
4
index.js
4
index.js
|
@ -5,7 +5,6 @@ const express = require('express')
|
||||||
const app = express()
|
const app = express()
|
||||||
const {verify} = require('hcaptcha')
|
const {verify} = require('hcaptcha')
|
||||||
|
|
||||||
console.log(`Connecting to ${process.env.MAIL_SERVER} as ${process.env.MAIL_USER} ${process.env.MAIL_PASS}`)
|
|
||||||
const mailer = require('nodemailer').createTransport({
|
const mailer = require('nodemailer').createTransport({
|
||||||
host: process.env.MAIL_SERVER,
|
host: process.env.MAIL_SERVER,
|
||||||
port: 587,
|
port: 587,
|
||||||
|
@ -30,7 +29,8 @@ app.post('/', async (req, res) => {
|
||||||
return res.sendStatus(500)
|
return res.sendStatus(500)
|
||||||
}
|
}
|
||||||
if (data.success === true) {
|
if (data.success === true) {
|
||||||
|
|
||||||
|
// Parse from address
|
||||||
let from
|
let from
|
||||||
if (req.body['name'] && req.body['email']) from = `${req.body['name']} <${req.body['email']}>`
|
if (req.body['name'] && req.body['email']) from = `${req.body['name']} <${req.body['email']}>`
|
||||||
else if (req.body['name']) from = req.body['name']
|
else if (req.body['name']) from = req.body['name']
|
||||||
|
|
Loading…
Reference in New Issue