feat(enterprise): add RESEND_FROM_EMAIL for self-hosted Resend sends#28830
Conversation
Allow self-hosted installs to override the default LiteLLM sender address via RESEND_FROM_EMAIL, matching SendGrid's SENDGRID_SENDER_EMAIL pattern. Co-authored-by: Cursor <[email protected]>
Greptile SummaryThis PR adds optional
Confidence Score: 5/5Safe to merge — a two-line production change with full mock test coverage and no behavior change when the env var is absent. The implementation is minimal and follows the existing SENDGRID_SENDER_EMAIL pattern exactly. The env var is read once at init (consistent with RESEND_API_KEY), the fallback preserves today's behavior, all new tests use mocks (no real network calls), and the fixture correctly isolates the env var across runs. No files require special attention.
|
| Filename | Overview |
|---|---|
| enterprise/litellm_enterprise/enterprise_callbacks/send_emails/resend_email.py | Adds RESEND_FROM_EMAIL env var support: reads it at init time and uses it as the sender address when set, falling back to the caller-supplied from_email. |
| tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_resend_email.py | Adds two new mock-only tests for the override and fallback paths; updates the mock_env_vars fixture to explicitly pop RESEND_FROM_EMAIL for isolation; whitespace cleanup elsewhere. |
Reviews (1): Last reviewed commit: "feat(enterprise): add RESEND_FROM_EMAIL ..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
967fed1
into
litellm_internal_staging
…erriAI#28830) Allow self-hosted installs to override the default LiteLLM sender address via RESEND_FROM_EMAIL, matching SendGrid's SENDGRID_SENDER_EMAIL pattern. Co-authored-by: Cursor <[email protected]>
Description
Adds optional RESEND_FROM_EMAIL support to ResendEmailLogger, matching the existing SendGrid pattern (SENDGRID_SENDER_EMAIL). Self-hosted installs can send from a domain verified in their own Resend account instead of the hardcoded LiteLLM default.
Cause
ResendEmailLogger always sent from [email protected] (via BaseEmailLogger.DEFAULT_LITELLM_EMAIL). That address works on LiteLLM Cloud but fails on self-hosted setups — Resend returns 403 Forbidden when the sender domain isn't verified on the caller's account.
SendGrid already supports a custom sender via SENDGRID_SENDER_EMAIL; Resend had no equivalent.
Fix
Read RESEND_FROM_EMAIL in ResendEmailLogger.init
Resolve sender as RESEND_FROM_EMAIL or from_email before calling the Resend API
Preserve existing behavior when the env var is unset (falls back to [email protected])
Add unit tests for override and fallback paths
Usage:
RESEND_API_KEY=re_xxxx
RESEND_FROM_EMAIL=[email protected] # verified domain in Resend
Test plan
uv run pytest tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_resend_email.py -v
Restart proxy with RESEND_FROM_EMAIL set; create a key with "Send email" enabled and confirm delivery in Resend dashboard