Skip to content

Email Notification System

Sanjay Kumar Sah edited this page Sep 6, 2024 · 1 revision

Email Notification System

The Email Notification System is a component of the Notification Service. It focuses on sending emails triggered by an API request (POST - api/v1/emails), managing email statuses, handling errors, and monitoring email activities.

High-Level Design

  • Architecture: This microservice manages email notifications by interfacing with the front end for templates (using react-email), sending emails via nodemailer, validating data with Zod, and storing email logs and metadata in MongoDB. RabbitMQ is utilized to handle email-sending tasks asynchronously.

Components

  • React-Email Components: Reusable UI components and templates for emails.
  • Email Service: Manages sending emails using nodemailer.
  • Database (MongoDB): Stores email logs, metadata, and tracking information.
  • Queue (RabbitMQ): Handles asynchronous processing of email-sending tasks.
  • Validation (Zod): Validates incoming email data.

Low-Level Design

1. Core UI Components (Atom Components)

These are the fundamental building blocks for email templates. Initial components include Link, Button, Typography, Image, and Icon. These components are designed to be simple and reusable.

2. Compound Components

These components are groups of atom components that together form parts of the final email template. Examples include Header and Footer.

3. Organism Components (Email Templates)

Organism components are constructed by combining atom and compound components to create complete email templates. These templates represent different email types, such as WelcomeEmail and ResetPasswordEmail.