Add "From" to feedback email body

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 😅
This commit is contained in:
Emi Matchu 2021-01-18 05:11:17 -08:00
parent ca088f3310
commit 0f61d59917

View file

@ -21,7 +21,11 @@ async function handle(req, res) {
contentSummary = contentSummary.slice(0, 40) + "…"; contentSummary = contentSummary.slice(0, 40) + "…";
} }
console.info(`Sending from ${email || "<anonymous>"}:\n${content}`); const senderText = email || "<anonymous>";
console.info(`Sending from ${senderText}:\n${content}`);
const body = `${content}\n\nSent by ${senderText}`;
try { try {
await sendgridMail.send({ await sendgridMail.send({
@ -29,7 +33,7 @@ async function handle(req, res) {
from: "impress-2020-feedback@openneo.net", from: "impress-2020-feedback@openneo.net",
subject: `DTI feedback: ${contentSummary}`, subject: `DTI feedback: ${contentSummary}`,
replyTo: email || undefined, replyTo: email || undefined,
text: content, text: body,
}); });
} catch (e) { } catch (e) {
console.error(e); console.error(e);