Skip to content

Integrate SendGrid for organization welcome/thank-you emails (replace Firebase mail sender) #477

@yuvraj-shishodia

Description

@yuvraj-shishodia

Description

Currently, welcome/thank-you emails sent after successful organization creation
are queued via Firebase’s mail collection. We want to replace this with a direct
SendGrid integration so emails are sent reliably via SendGrid instead of relying
on the Firebase email extension/service.

This issue tracks implementing SendGrid as the primary email provider for the
organization creation thank-you email flow.


Current Behavior

  • After creating an organization, a thank-you/welcome email is queued via
    Firebase’s mail collection
  • Delivery depends on the Firebase email extension or a custom mail listener
  • Email provider configuration is indirect and harder to monitor

Expected Behavior

  • After successful organization creation, a thank-you/welcome email is sent via
    SendGrid
  • Firebase mail collection is no longer used for this specific flow
  • Email delivery status can be monitored via SendGrid logs/dashboard
  • Failures are handled gracefully (retry/logging)

Scope

Backend

  • Add SendGrid client configuration (API key via env/secret)
  • Implement SendGrid send helper for organization welcome emails
  • Replace Firebase mail enqueue logic for this flow with SendGrid send call
  • Add basic error handling and logging for send failures

Email Template

  • Migrate the existing welcome/thank-you email template to SendGrid format
  • Support subject + HTML/text body
  • Ensure personalization fields (org name, user name, etc.) are preserved

Configuration & Security

  • Store SendGrid API key securely (env/secret manager)
  • Ensure keys are not committed to the repo
  • Add environment-specific configuration (dev/staging/prod)

Acceptance Criteria

  • Organization creation triggers a SendGrid email successfully
  • Firebase mail collection is no longer used for this flow
  • Email content matches the existing welcome/thank-you template
  • SendGrid failures are logged and do not break org creation
  • Configuration works in dev/staging/prod

Out of Scope

  • Migrating other email flows to SendGrid (tracked separately if needed)
  • Bulk email or marketing emails

Notes

  • Confirm SendGrid account, sender identity, and domain authentication
  • Product may want to review email content before final rollout

Metadata

Metadata

Labels

BackendBackend authenticationsenhancementNew feature or requestsize:S3-5 days

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions