Skip to content

fix(api): honor self-hosted email sender settings - #803

Merged
izadoesdev merged 4 commits into
stagingfrom
codex/selfhost-email-senders
Sep 17, 2026
Merged

izadoesdev merged 4 commits into
stagingfrom
codex/selfhost-email-senders

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Sep 15, 2026

Copy link
Copy Markdown
Member

Alarm notifications ignored configured sender addresses and used the hosted databuddy.cc sender. Resolve them through the existing ALERTS_EMAIL_FROMEMAIL_FROM fallback, make the example alert override optional, and forward both sender variables through Turbo. Hosted sender defaults and per-alarm overrides remain unchanged.

This six-file change covers notification sender resolution and its delivery regression test, the existing @databuddy/env workspace dependency, .env.example, and Turbo configuration. Self-hosted Compose wiring and setup documentation belong to companion #804; the two PRs can land independently.

Validation: root bun run lint, all 33 typecheck tasks, and all 27 root test tasks pass. The notifications suite passes 30 tests, including mocked outbound delivery and all four sender-precedence cases. The delivery regression also covers channel selection and the default recipient, replacing a duplicate target-construction test. Full pre-push command output was captured locally.

AI-assisted implementation and verification with Codex.

@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
dashboard Ready Ready Preview Sep 17, 2026 7:02am UTC
databuddy-status Ready Ready Preview Sep 17, 2026 7:02am UTC
1 Skipped Deployment
Project Deployment Actions Updated
documentation Skipped Skipped Sep 17, 2026 7:02am UTC

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 31908e68-1ae7-4480-a6c8-f294b88d2d00

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@unkey-deploy

unkey-deploy Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Unkey Deploy

Name Status Preview Inspect Updated (UTC)
links (preview) Ready Visit Preview Inspect Sep 17, 2026 7:01am

@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the final head correctly applies sender precedence and resolves both previous repository-rule findings.

Summary

This PR makes alarm notifications honor self-hosted sender configuration while preserving per-alarm overrides and hosted defaults.

  • Resolves alarm senders through the existing ALERTS_EMAIL_FROMEMAIL_FROM configuration fallback.
  • Keeps non-empty per-destination sender overrides at the highest precedence.
  • Adds the environment package dependency and forwards both sender variables through Turbo.
  • Updates the example environment configuration and adds delivery-level regression coverage for sender precedence.
  • Replaces the loop and prohibited delete operator identified in the previous review with parameterized tests and Reflect.deleteProperty.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Build alarm email target] --> B{Non-empty destination from?}
    B -- Yes --> C[Use destination override]
    B -- No --> D{ALERTS_EMAIL_FROM configured?}
    D -- Yes --> E[Use alert-specific sender]
    D -- No --> F[Use EMAIL_FROM fallback]
    C --> G[Send through Resend]
    E --> G
    F --> G
Loading

Reviews (2) · Last reviewed commit: "test(api): isolate alarm sender regressi..."

Comment thread packages/notifications/src/__tests__/alarm-config.test.ts
Comment thread packages/notifications/src/__tests__/alarm-config.test.ts Outdated
@izadoesdev

Copy link
Copy Markdown
Member Author

@greptileai review this. The two test-style findings are fixed in f27025c; please review the final head.

@izadoesdev
izadoesdev merged commit 924d55b into staging Sep 17, 2026
22 checks passed
@izadoesdev
izadoesdev deleted the codex/selfhost-email-senders branch September 17, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant