feat(email): implement robust email recipient forwarding and centralized configuration#23
Merged
JacksonR64 merged 4 commits intomainfrom Jun 19, 2025
Merged
Conversation
- Replace simple NODE_ENV check with more reliable environment detection - Add OVERRIDE_EMAILS_TO_DEV environment variable for explicit control - Use dual check: OVERRIDE_EMAILS_TO_DEV=true AND local development - Prevent email redirection in production even if NODE_ENV is misconfigured - Update both email-service.ts and send-ticket-confirmation.ts This ensures emails always go to the intended recipient in production while maintaining the ability to override for local development testing. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update RESEND_FROM_EMAIL to use custom domain noreply@localloopevents.xyz - Update NEXT_PUBLIC_APP_URL to use new production domain - Remove email override for proper user email delivery - Clean up test scripts This enables free email sending to any recipient using verified domain. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update contact page email: hello@localloop.events → hello@localloopevents.xyz - Update all support emails: support@localloop.app → support@localloopevents.xyz - Update system emails: noreply@localloop.app → noreply@localloopevents.xyz - Update organizer emails: organizer@localloop.app → organizer@localloopevents.xyz - Update from email configuration to use hello@localloopevents.xyz - Update email templates, API routes, and documentation - Ensure consistent branding across all email communications This provides a professional, consistent email experience using the verified custom domain. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…bility - Create centralized email configuration in lib/config/email-addresses.ts - Define all email addresses as constants with proper subdomain structure: * SYSTEM_FROM: noreply@localloopevents.xyz (for automated emails) * CONTACT: hello@localloopevents.xyz (for customer contact) * SUPPORT: support@localloopevents.xyz (for support inquiries) * ORGANIZER: organizer@localloopevents.xyz (for event organizers) - Restore RESEND_FROM_EMAIL to noreply@localloopevents.xyz for system messages - Update all files to import and use centralized EMAIL_ADDRESSES: * Contact page now uses EMAIL_ADDRESSES.CONTACT * Email service uses EMAIL_ADDRESSES for all email types * Email templates use centralized support addresses * API routes use EMAIL_ADDRESSES.ORGANIZER and generateUserEmail() - Maintain proper subdomain separation: * noreply@ for system/automated emails * hello@ for customer contact * support@ for customer support * organizer@ for event organizer fallbacks This provides a single source of truth for all email addresses, making domain changes and email management much easier to maintain. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🚀 PR Quick Check Results
🎉 All quick checks passed! Your PR is ready for full CI pipeline. This is a quick check for immediate feedback. Full testing will run in the main CI pipeline. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes email recipient forwarding issues and implements a centralized, maintainable email configuration system for LocalLoop.
Key Changes
🔧 Email Recipient Forwarding Fix
OVERRIDE_EMAILS_TO_DEV=trueAND local development)NODE_ENVis misconfiguredOVERRIDE_EMAILS_TO_DEVenvironment variable for testing control🏗️ Centralized Email Configuration
lib/config/email-addresses.tsfor all email addressesnoreply@localloopevents.xyz- System/automated emailshello@localloopevents.xyz- Customer contactsupport@localloopevents.xyz- Customer supportorganizer@localloopevents.xyz- Event organizer fallbacks🌐 Custom Domain Integration
localloopevents.xyzwith Resend DNS verificationFiles Modified
Core Configuration
lib/config/email-addresses.ts- New centralized email configurationlib/email-service.ts- Updated to use centralized config and robust recipient logiclib/emails/send-ticket-confirmation.ts- Updated recipient forwarding logic.env.local- AddedOVERRIDE_EMAILS_TO_DEVcontrol variableEmail Templates & Contact
app/contact/page.tsx- Uses centralized contact emaillib/emails/welcome-email.tsx- Uses centralized support emailAPI Routes
app/api/rsvps/route.ts- Uses centralized organizer emailapp/api/rsvps/[id]/route.ts- Uses centralized organizer emailapp/api/events/reminders/route.ts- Uses centralized organizer emailapp/api/events/cancellation/route.ts- Uses centralized organizer emailapp/api/auth/google/callback/route.ts- Uses dynamic user email generationConfiguration
next.config.ts- Updated production URL to custom domainTest Results
Breaking Changes
None - all changes are backwards compatible.
Environment Variables Required
Development (.env.local)
RESEND_FROM_EMAIL=noreply@localloopevents.xyz OVERRIDE_EMAILS_TO_DEV=false # Set to true for local testingProduction (Vercel)
Benefits
Testing Instructions
OVERRIDE_EMAILS_TO_DEV=falsein development🤖 Generated with Claude Code