Don't send email when address doesn't exist

This commit is contained in:
2017-03-05 12:41:00 +00:00
parent f87cd125d5
commit 28ac78e143

View File

@@ -38,7 +38,7 @@ ${person.attending && person.dietary.length > 0 ? `<p>Your dietary requirements
export const sendRSVPEmail = function sendRSVPEmail(person) { export const sendRSVPEmail = function sendRSVPEmail(person) {
Settings.findAll().then(data => { Settings.findAll().then(data => {
if (data[0].email) { if (data[0].email && person.email) {
const mailOptions = { const mailOptions = {
from: `"${email.senderName}" <${email.senderAddress}>`, from: `"${email.senderName}" <${email.senderAddress}>`,
to: person.email, to: person.email,