summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-01-24 10:09:47 +0000
committerJoe Carstairs <me@joeac.net>2026-01-24 10:09:47 +0000
commit3e14e8acbecea6ba5d9b98d5bb41c4cad8d9b865 (patch)
treea2ae39c8b4bc5e9cdd40edf87be36a50d3b3dbaf
parent9c7ed56823a4ba02d9e70f3a9dc4f00c9987add3 (diff)
adds OTP emails to SentEmails table
-rw-r--r--website/src/actions/otp/send-otp.ts4
-rw-r--r--website/src/actions/sendmail.ts1
2 files changed, 5 insertions, 0 deletions
diff --git a/website/src/actions/otp/send-otp.ts b/website/src/actions/otp/send-otp.ts
index 2781061..ee7fe35 100644
--- a/website/src/actions/otp/send-otp.ts
+++ b/website/src/actions/otp/send-otp.ts
@@ -50,6 +50,10 @@ to do anything.`,
`Sent OTP (${otpPretty}) to ${email}. Message ID: ${info.messageId}`,
);
+ await db
+ .insert(SentEmails)
+ .values({ messageId: info.messageId, sentAt: Date.now() });
+
await db.insert(Otp).values({
userId: email,
value: otp,
diff --git a/website/src/actions/sendmail.ts b/website/src/actions/sendmail.ts
index 06bd08a..bc3a2fa 100644
--- a/website/src/actions/sendmail.ts
+++ b/website/src/actions/sendmail.ts
@@ -75,6 +75,7 @@ async function sendmail({
subject: `joeac.net: ${name} left a message`,
text: `${name} <${email}> sent you a message:\n\n\n${message}`,
});
+
await db
.insert(SentEmails)
.values({ messageId: info.messageId, sentAt: Date.now() });