Skip to content

Mail issues - #256

Merged
8 commits merged into
mainfrom
mail_issues
Oct 28, 2026
Merged

8 commits merged into
mainfrom
mail_issues

Conversation

@samanvitha7

Copy link
Copy Markdown
Collaborator

No description provided.

- Add connection pooling and reusable transporter to nodemailer configuration
- Validate EMAIL_ID and EMAIL_PASSWORD with early return to avoid network timeouts
- Introduce critical flag so notification failures log instead of throwing
- Support dynamic FRONTEND_URL in emailTemplates instead of hardcoded domain
…gnup failure

- Resolve broken URL concatenation by extracting clean origin via getFrontendBaseUrl helper
- Automatically roll back user record if verification email fails during signup to prevent lockout
- Eliminate manual bcrypt hashing in resetPassword to prevent double-hashing
- Make alumni verification notification email non-blocking to prevent false failure responses
- Add POST /auth/resend-verification endpoint for expired or missing verification tokens
…il notifications

- Wrap notification email dispatch in try-catch so SMTP errors do not fail core operations
- Prevent self-notifications for post authors commenting or asking questions on their own posts
- Add recipient email fallback to instituteEmail/personalEmail across notification flows
… non-blocking

- Support personalEmail for alumni and users without instituteEmail on achievement submission
- Wrap achievement notification dispatch in try-catch so submission succeeds even if email fails
…eholders

- Document EMAIL_ID, EMAIL_PASSWORD, and FRONTEND_URL
- Include server port and CORS origin setup guide
… EditPost

- Check for token existence before initiating post create or update requests
- Catch 401 responses, clear expired token, show user-friendly message, and redirect to login
- Use port 465 with direct SSL for reliable cloud delivery
- Strip accidental whitespace from EMAIL_PASSWORD
- Remove socket pooling to prevent frozen serverless connection timeouts
- Add explicit socket, greeting, and connection timeouts
}
console.error("Error creating post:", error);
}
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch improves the create-post flow by handling unauthenticated users before the request is sent and by gracefully handling expired sessions with a clearer message and redirect. The error handling is more user-friendly and avoids leaving stale auth state behind. No blockers from this diff

} catch (emailErr) {
console.error("Non-blocking error sending answer notification email:", emailErr);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change improves reliability by ensuring answer notifications do not block the answer creation flow if email delivery fails. The fallback to instituteEmail and non-blocking error handling are sensible, and they reduce user-facing disruption without changing the main business logic.

verifyPasswordResetEmail,
resetPassword,
resendVerificationEmail,
}; No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with minor note: the patch is a clear improvement and addresses real reliability issues in signup/reset email flows. The safer URL construction, rollback on email failure, and more resilient handling of verified/unverified states are all positive. I’d only suggest adding a couple of focused tests for the URL-generation edge cases and the resend/forgot-password flows to prevent regressions.

@samanvitha7 samanvitha7 closed this pull request by merging all changes into main in 9b51646 Oct 28, 2026
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