# πŸ“§ Email Microservice A modern email microservice built with Hono and TypeScript, supporting multiple languages and HTML/Text email templates. ## ✨ Features - 🌐 Multi-language support (English & German) - πŸ“ HTML and Text email templates - πŸ“š OpenAPI/Swagger documentation - ⚑ High-performance with Bun runtime - πŸ”„ Queue-based email processing - 🎨 Handlebars templating ## πŸš€ Quick Start ```bash # Install dependencies bun install # Start development server bun dev ``` ## πŸ“– API Documentation Swagger UI is available at: `/swagger` ## πŸ” Example API Calls ### Send Welcome Email ```bash curl -X POST http://localhost:3000/api/v1/email \ -H "Content-Type: application/json" \ -d '{ "to": "user@example.com", "templateName": "welcome", "language": "en", "data": { "name": "John Doe", "barcode_content": "0123456789", "link": "https://portal.lauf-fuer-kaya.de/" } }' ``` ### Send Password Reset Email ```bash curl -X POST http://localhost:3000/api/v1/email \ -H "Content-Type: application/json" \ -d '{ "to": "user@example.com", "templateName": "password-reset", "language": "de", "data": { "token": "123465789" } }' ``` ### Check Queue Status ```bash curl http://localhost:3000/api/v1/email/status ``` ## πŸ“ Environment Variables ```env SMTP_HOST=localhost SMTP_PORT=587 SMTP_USER="project.1" SMTP_PASS="secret.1" EMAIL_FROM="noreply@lauf-fuer-kaya.de" EMAIL_REPLYTO="info@lauf-fuer-kaya.de" REDIS_URL=redis://localhost:6379 FRONTEND_URL="https://run.lauf-fuer-kaya.de" AUTHKEY="" EVENT_DATE="23.05.2025" EVENT_NAME="Lauf fΓΌr Kaya! 2025" ``` ## πŸ› οΈ Development The project uses: - πŸƒβ€β™‚οΈ Bun for runtime and package management - 🌐 Hono for the web framework - πŸ“š Zod for validation - πŸ“§ Nodemailer for email sending - πŸ“‘ Handlebars for templating - πŸ“Š BullMQ for queue management ## πŸ“¦ Available Templates ### Welcome Email - Languages: πŸ‡¬πŸ‡§ English, πŸ‡©πŸ‡ͺ German - Variables: `name`, `link`, `barcode_content` ### Password Reset - Languages: πŸ‡¬πŸ‡§ English, πŸ‡©πŸ‡ͺ German - Variables: `token`