Skip to content

feat: Add local Nodemailer fallback for development email service - #225

Open
karthik768990 wants to merge 1 commit into
Viveckh:developfrom
karthik768990:feature/local-nodemailer-support
Open

feat: Add local Nodemailer fallback for development email service#225
karthik768990 wants to merge 1 commit into
Viveckh:developfrom
karthik768990:feature/local-nodemailer-support

Conversation

@karthik768990

Copy link
Copy Markdown

Summary

This PR introduces a local Nodemailer fallback for sending emails in development.
It removes the dependency on SendGrid API keys for local testing and simplifies user/admin creation workflows.

Problem

Currently, developers must configure SendGrid API keys even for local development, which blocks setup.

Solution

  • Added a Nodemailer-based local email service (emailServiceNodemailer.js)
  • Updated emailService.js to select between SendGrid (production) and Nodemailer (local) using the EMAIL_SERVICE environment variable.
  • Local .env file can be used for Gmail credentials for Nodemailer.

Testing

  1. Create a .env file in shopping-server with:
    EMAIL_SERVICE=nodemailer
    VENIQA_NODEMAILER_USER=<your_gmail>
    VENIQA_NODEMAILER_PASSWORD=<app_password>
  2. Run npm run dev.
  3. Create a new user/admin → confirmation email should be sent via Gmail.

Notes

  • .env should never be committed; add it to .gitignore.
  • Default behavior for production (SendGrid) remains unchanged.
  • Simplifies onboarding for new developers.

###Comment: I haven't included the .env as it contains some sensitive information and the developers should create their own .env files

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