feat: add email notification for post like

This commit is contained in:
Krispire Admin
2026-06-09 16:57:12 +05:30
parent e9299051f5
commit d86d876ac1
6 changed files with 165 additions and 30 deletions
@@ -0,0 +1,2 @@
ALTER TABLE users DROP COLUMN IF EXISTS like_emails_enabled;
ALTER TABLE notifications DROP COLUMN IF EXISTS like_email_sent_at;
+9
View File
@@ -0,0 +1,9 @@
-- Aggregated like emails.
--
-- like_email_sent_at throttles the per-post like email: once an aggregated
-- "X and N others liked your post" email goes out, further likes within the
-- throttle window only update the in-app/push aggregate, not a fresh email.
ALTER TABLE notifications ADD COLUMN IF NOT EXISTS like_email_sent_at TIMESTAMPTZ;
-- Per-user opt-out for like emails (push + in-app are unaffected).
ALTER TABLE users ADD COLUMN IF NOT EXISTS like_emails_enabled BOOLEAN NOT NULL DEFAULT TRUE;