From 2814d5520623efe5f48c26f639d3ed6cc5f0d8d2 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Mon, 15 Dec 2025 20:17:22 -0800 Subject: Add email integration --- src/activity/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/activity/index.ts') diff --git a/src/activity/index.ts b/src/activity/index.ts index d3537b4..ea2ae09 100644 --- a/src/activity/index.ts +++ b/src/activity/index.ts @@ -18,6 +18,7 @@ import type { Storage } from '../storage/index.js'; import { ContentType } from '../types/index.js'; import { verifyHCaptcha } from '../integrations/hcaptcha.js'; import { sendNtfyNotification } from '../integrations/ntfy.js'; +import { sendEmailNotification } from '../integrations/email.js'; import { TokenSigner } from '../token/index.js'; const webhookRequestMetric = Metric.fromName('Webhook.Process').asResult(); @@ -310,6 +311,17 @@ export class WebhookActivityImpl implements IWebhookActivity { } } + // Send email notification if configured + if (route.email?.enabled) { + const emailResult = await sendEmailNotification(route.email, storedRequest); + if (emailResult.left().present()) { + const err = emailResult.left().get(); + tReq.trace.traceScope(LogLevel.WARN).trace(`email notification failed: ${err.message}`); + } else { + tReq.trace.trace('email notification sent'); + } + } + const baseName = `${storedRequest.timestamp}_${storedRequest.uuid}`; return tReq.move( -- cgit v1.2.3-70-g09d2