📧 Email Service

Service Documentation

📋 Service Information

Service Name: Email Service

Port: 8055

Base URL: http://localhost:8055

Description: Handles email notifications via Kafka events. This is an event-driven service that consumes Kafka messages and sends emails.

Architecture: Kafka Consumer Service - No REST API endpoints

â„šī¸ Important Note

This service does not expose REST API endpoints. It operates as a Kafka consumer, listening to events from other services and sending emails accordingly.

To send emails, other services should publish events to the configured Kafka topics.

📨 Kafka Topics Consumed
TOPIC user-registration-email

User Registration Email

Consumes events when a new user is registered. Sends welcome email with login credentials.

Event Structure: Contains email request with template data for registration email

TOPIC email-topic

Generic Email Topic

Consumes generic email events. Can send any email template based on the event data.

Event Structure: Contains email request with template name and template data

📧 Available Email Templates
âš™ī¸ Configuration

SMTP Configuration

Host: smtp.gmail.com

Port: 587

Security: STARTTLS enabled

From Address: noreply@qms.appadvent.com

From Name: QMS System

Base URL: http://localhost:3000 (for email links)

Kafka Configuration

Bootstrap Servers: localhost:9092

Consumer Group: email-service-group

Auto Offset Reset: earliest

📝 How to Send Emails

Publishing Email Events

To send an email, publish an event to one of the Kafka topics with the following structure:

{ "emailRequest": { "toEmail": "user@example.com", "subject": "Email Subject", "templateName": "registration-email", "templateData": { "fullName": "John Doe", "email": "user@example.com", "password": "password123", "loginUrl": "http://localhost:3000/login", "websiteUrl": "http://localhost:3000", "supportEmail": "support@qms.com", "year": 2025 } } }