From 0921df432b9af62e313f2238de23fb9702691c03 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Thu, 14 Jul 2016 11:40:46 -0700 Subject: [PATCH] Uses default from address --- packages/nylas-api/routes/send.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/nylas-api/routes/send.js b/packages/nylas-api/routes/send.js index e987bcbfa..90725786c 100644 --- a/packages/nylas-api/routes/send.js +++ b/packages/nylas-api/routes/send.js @@ -35,15 +35,13 @@ module.exports = (server) => { for (key of ['from', 'to', 'cc', 'bcc']) { if (data[key]) msg[key] = toParticipant(data[key]) } + if (!msg.from || msg.from.length === 0) { + msg.from = `${account.name} <${account.emailAddress}>` + } msg.subject = data.subject, msg.html = data.body, - console.log("------------------------------------------------") - console.log(msg) sender.sendMail(msg, (error, info) => { - console.log("DONE ==========================================="); - console.log(error) - console.log(info) if (error) { reply(error).code(400) } else { reply(info.response) } });