Skip to content

Fix/email service fallback#223

Open
aarushii25 wants to merge 7 commits into
KENZY004:mainfrom
aarushii25:fix/email-service-fallback
Open

Fix/email service fallback#223
aarushii25 wants to merge 7 commits into
KENZY004:mainfrom
aarushii25:fix/email-service-fallback

Conversation

@aarushii25

Copy link
Copy Markdown
Contributor

Hey @KENZY004! 👋
#211
I've fixed this issue. Here's what I did:

Changes Made:

  1. server/services/emailService.js
    Added a graceful fallback at the start of sendRegistrationVerificationEmail() — when SMTP_USER and RESEND_API_KEY both are missing, instead of failing and deleting the user, it now:

Logs the OTP to the server console in dev mode
Returns { success: true } so registration completes normally

  1. server/.env.example
    Added all required email environment variables with clear comments so contributors know exactly what to configure.

Testing Done:

✅ Signup with no email credentials configured → OTP printed in server terminal → Verification page loads → Account activated successfully
✅ No user deletion on missing email config
✅ .env.example documents all required variables clearly

Before this fix: Registration failed with "Failed to send verification email" and user was deleted.

After this fix: In dev mode, OTP is logged to console and registration completes successfully. In production with proper credentials, normal email flow works as before.

Ready for review!
Screenshot 2026-07-24 071852
Screenshot 2026-07-24 072057
Screenshot 2026-07-24 072119

@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

@aarushii25 is attempting to deploy a commit to the MINHA's projects Team on Vercel.

A member of the Team first needs to authorize it.

@KENZY004

Copy link
Copy Markdown
Owner

Hey @aarushii25, thanks for the detailed PR description and the testing screenshots! The fallback feature looks exactly like what we need.

However, there are a couple of issues we need to address before this can be merged:

  1. 🔴 Missing Files in the PR It looks like the backend changes are missing from the PR. The files server/services/emailService.js and server/.env.example that you listed under "Changes Made" are not included in the commits pushed to this branch. Please make sure to track, commit, and push these files so we can review them!

  2. 🔴 Clean up debug comments There are some inline comments in Hindi left in the client code (e.g., in App.jsx and FAQPage.jsx):
    Please remove these comments before we merge.

Once you push the missing backend files and clean up the comments, I'll be happy to review it again.

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.

2 participants