Skip to content

Commit 8d08b93

Browse files
matteiusclaude
andcommitted
feat: activate per-brand email senders for LightNVR and OwlBooks
Sets brand.email_from_email and email_from_name on the LightNVR and OwlBooks brand rows now that both domains are configured as Mailjet sending domains with DKIM/SPF verified. members.lightnvr.com → LightNVR <support@lightnvr.com> members.owlbooks.ai → OwlBooks <support@owlbooks.ai> members.opensensor.io: unchanged (NULL → falls back to tenant / matt@opensensor.io as today) With the resolver wired up in the previous commit, transactional emails (welcome, email verification, forgot password) now stamp the From: line with the brand the user signed in / signed up under. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0800480 commit 8d08b93

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
"""Set per-brand email_from_email / email_from_name for LightNVR and OwlBooks
2+
3+
Revision ID: e9a1c3b7d2f4
4+
Revises: d5a8f2c1e4b9
5+
Create Date: 2026-05-02 13:30:00.000000
6+
7+
"""
8+
9+
import sqlalchemy as sa
10+
from alembic import op
11+
12+
# revision identifiers, used by Alembic.
13+
revision = "e9a1c3b7d2f4"
14+
down_revision = "d5a8f2c1e4b9"
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
table_prefix = op.get_context().opts["table_prefix"]
21+
op.execute(
22+
sa.text(
23+
f"UPDATE {table_prefix}brands "
24+
"SET email_from_email = 'support@lightnvr.com', "
25+
" email_from_name = 'LightNVR' "
26+
"WHERE host = 'members.lightnvr.com'"
27+
)
28+
)
29+
op.execute(
30+
sa.text(
31+
f"UPDATE {table_prefix}brands "
32+
"SET email_from_email = 'support@owlbooks.ai', "
33+
" email_from_name = 'OwlBooks' "
34+
"WHERE host = 'members.owlbooks.ai'"
35+
)
36+
)
37+
38+
39+
def downgrade():
40+
table_prefix = op.get_context().opts["table_prefix"]
41+
op.execute(
42+
sa.text(
43+
f"UPDATE {table_prefix}brands "
44+
"SET email_from_email = NULL, email_from_name = NULL "
45+
"WHERE host IN ('members.lightnvr.com', 'members.owlbooks.ai')"
46+
)
47+
)

0 commit comments

Comments
 (0)