chore(email): log successful sends for observability

Previously sendEmail() only logged on error/suppression paths; success
was silent. After prod deploy of c71c401 it was unclear whether the
first alert tick had actually delivered email or not - the answer was
yes but had to be derived from 'no error log + recipient query showed
matching device'. Add a log line on success so future observability
doesn't require detective work.
This commit is contained in:
ScreenTinker 2026-05-12 18:34:19 -05:00
parent dddc48440b
commit f4d2a0330b

View file

@ -138,6 +138,7 @@ async function sendEmail({ to, subject, text, html }) {
try {
const token = await getAccessToken();
await postSendMail(token, buildSendMailPayload(to, subject, text, html));
console.log(`[EMAIL] sent to ${to}: ${subject}`);
return { sent: true };
} catch (e) {
console.error(`[EMAIL] Graph send failed for ${to}: ${e.message}`);