paisable icon indicating copy to clipboard operation
paisable copied to clipboard

feat: add welcome email to be sent to new registering user

Open onipinaka opened this issue 1 year ago • 5 comments

Description

This PR adds a welcome email feature to the Paisable application. Now, when a new user successfully registers, the backend automatically sends a friendly welcome email confirming their account creation. The email is sent using either SendGrid (if configured) or Gmail SMTP as a fallback.

Related Issue: fixes #9

The email sending is implemented as a fire-and-forget operation, meaning it does not block or delay the user registration process. Any failures in the email service are logged, but the user account is still created and the API response is returned immediately.

Changes include:

  • Added sendEmail.js utility in backend/utils/ to handle email sending.
  • Updated signup function in authController.js to call sendWelcomeEmail after successful account creation.
  • Emails include a friendly HTML and text message with guidance on next steps in the app.
  • Supports both SendGrid API and Gmail SMTP configuration via .env.

Related Issue

Fixes #


Motivation and Context

Previously, when a new user registered, there was no confirmation or onboarding email, which could make the app feel less professional and reduce user engagement. This feature:

  • Improves user onboarding with a welcoming message.
  • Provides basic email validation (successful delivery indicates a working email).
  • Encourages users to start exploring the application immediately.

Types of Changes

  • [x] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Registered new users locally and verified that:
    • API response returns correctly without delay.
    • Emails are sent to the user using configured email service.
    • Failures in email sending (e.g., incorrect API key) are logged but do not block registration.
  • Tested with both SendGrid API key and Gmail SMTP fallback.

Screenshots (if applicable):

  • N/A — backend feature only.

Checklist

  • [x] My code follows the code style of this project
  • [x] My change requires a change to the documentation
  • [x] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [x] All new and existing tests passed

onipinaka avatar Oct 04 '25 10:10 onipinaka

Deploy Preview for paisable ready!

Name Link
Latest commit 9a6c43c14bf9dcc1effc887bcd44a0ea9e97729d
Latest deploy log https://app.netlify.com/projects/paisable/deploys/68e54a6ad8370f0008f6647b
Deploy Preview https://deploy-preview-78--paisable.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 95
Accessibility: 100
Best Practices: 100
SEO: 82
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify avatar Oct 04 '25 10:10 netlify

Kindly cross-link the corresponding issue. Thanks!

archa8 avatar Oct 04 '25 14:10 archa8

I linked my PR with the issue, please Re-review

onipinaka avatar Oct 06 '25 19:10 onipinaka

@archa8 Please merge it.

onipinaka avatar Oct 09 '25 10:10 onipinaka

@onipinaka There are some conflicts right now. Kindly pull the recent changes and resolve the conflicts as pointed out by Git.

archa8 avatar Oct 09 '25 19:10 archa8