From 0f61d59917da17cc7b80520657528c61f6b15521 Mon Sep 17 00:00:00 2001 From: Matchu Date: Mon, 18 Jan 2021 05:11:17 -0800 Subject: [PATCH] Add "From" to feedback email body MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is just a convenience to make it easier to see at a glance in my inbox whether I should reply to the email, or whether it just goes nowhere 😅 --- api/sendFeedback.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/sendFeedback.js b/api/sendFeedback.js index 3c82c6d..4a3d96e 100644 --- a/api/sendFeedback.js +++ b/api/sendFeedback.js @@ -21,7 +21,11 @@ async function handle(req, res) { contentSummary = contentSummary.slice(0, 40) + "…"; } - console.info(`Sending from ${email || ""}:\n${content}`); + const senderText = email || ""; + + console.info(`Sending from ${senderText}:\n${content}`); + + const body = `${content}\n\nSent by ${senderText}`; try { await sendgridMail.send({ @@ -29,7 +33,7 @@ async function handle(req, res) { from: "impress-2020-feedback@openneo.net", subject: `DTI feedback: ${contentSummary}`, replyTo: email || undefined, - text: content, + text: body, }); } catch (e) { console.error(e);