Skip to content

Feature/149 email notification adapter#155

Merged
ahmadogo merged 2 commits intoMentoNest:mainfrom
mijinummi:feature/149-email-notification-adapter
Jan 31, 2026
Merged

Feature/149 email notification adapter#155
ahmadogo merged 2 commits intoMentoNest:mainfrom
mijinummi:feature/149-email-notification-adapter

Conversation

@mijinummi
Copy link
Contributor

📧 Implement Provider-Agnostic Email Notification Adapter

Context

The platform requires a flexible and safe email notification system to support booking and payment events without coupling the application to a single email provider. This PR introduces a provider-agnostic email adapter with templated emails and a mock provider for development and testing environments.


✨ What’s Included

🔌 Provider-Agnostic Email Adapter

  • Unified sendEmail() API for system notifications
  • Adapter-based design allowing easy provider swapping
  • Clean abstraction to support SendGrid, SES, Mailgun, etc.

🧪 Mock Provider (Dev & Test Safe)

  • Mock email provider that logs email content instead of sending
  • Prevents accidental email sends in development and CI
  • Ideal for local testing and automated tests

📨 Templated Emails

  • Handlebars-based template rendering
  • Booking-related email templates
  • Payment-related email templates
  • Dynamic data injection via template variables

⚙️ Environment-Based Configuration

  • Email provider selected using environment variables
  • Zero code changes required to switch providers

📊 Logging & Observability

  • Logs successful email sends
  • Logs failures with error context
  • Improves debugging and operational visibility

🧪 Test Coverage

  • Email adapter behavior verified via unit tests
  • Template rendering tested independently
  • Ensures adapter API remains provider-agnostic

✅ Acceptance Criteria Checklist

  • Booking email templates implemented
  • Payment email templates implemented
  • Provider-agnostic email adapter
  • Mock provider for development/testing
  • Environment-based configuration
  • Basic logging for send results and failures
  • Unit tests for adapter and template rendering

🔮 Future Extensions

This implementation enables:

  • Adding real providers (SendGrid, SES, Mailgun) without refactor
  • Event-driven notifications (booking/payment hooks)
  • Expansion to SMS or push notifications using the same pattern

Notes for Reviewers

  • No breaking changes to existing modules
  • Safe-by-default behavior in non-production environments
  • Designed for extensibility and maintainability
    Closes Email Notification Adapter #149

@ahmadogo ahmadogo merged commit fe7126d into MentoNest:main Jan 31, 2026
0 of 2 checks passed
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.

Email Notification Adapter

2 participants