Skip to content

Muaz841/EmailSender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Queue Manager

Description Email Queue Manager is a multi-tenant application built on the ASP.NET Zero framework with an Angular frontend. It provides a robust email-sending process with a queue-based system, retry mechanism, and failed email handling. The application uses SMTP for email delivery, making it suitable for scalable, tenant-specific email automation workflows. This project is ideal for developers and businesses needing reliable email communication in a multi-tenant environment. Key Features

Queue-Based Email Processing: Manages email sending through a queue to ensure efficient delivery. Retry Mechanism: Automatically retries failed email deliveries with configurable settings. Failed Email Handling: Tracks and manages failed emails for troubleshooting and reprocessing. Multi-Tenant Support: Supports multiple tenants with isolated email configurations. SMTP Integration: Seamlessly integrates with SMTP servers for email delivery.

Prerequisites Before setting up the project, ensure you have the following installed:

.NET Core SDK (version 3.1 or later) Node.js (version 14.x or later) Angular CLI (version 12.x or later) SQL Server or another compatible database An SMTP server (e.g., Gmail, SendGrid) with valid credentials Git for cloning the repository

Installation Follow these steps to set up the project locally:

Clone the Repository: git clone https://github.com/your-username/email-queue-manager.git cd email-queue-manager

Restore Backend Dependencies:Navigate to the ASP.NET Zero backend project folder and restore dependencies: cd src/EmailQueueManager.Web dotnet restore

Install Frontend Dependencies:Navigate to the Angular frontend folder and install dependencies: cd angular npm install

Configure the Database:

Update the connection string in appsettings.json (located in src/EmailQueueManager.Web) to point to your SQL Server instance. Run database migrations:dotnet ef database update

Configure SMTP Settings:

Update the SMTP configuration in appsettings.json with your SMTP server details (e.g., host, port, credentials). Example:"SmtpSettings": { "Host": "smtp.gmail.com", "Port": 587, "Username": "your-email@gmail.com", "Password": "your-smtp-password", "UseSsl": true }

Run the Backend: cd src/EmailQueueManager.Web dotnet run

Run the Frontend:In a new terminal, navigate to the Angular folder and start the frontend: cd angular ng serve

Access the Application:

Backend API: http://localhost:5000 Angular Frontend: http://localhost:4200 Default credentials: Username: admin Password: 123qwe

Usage Sending an Email To send an email, use the API endpoint or the Angular frontend interface:

API Example (using cURL): curl -X POST http://localhost:5000/api/emails/send
-H "Content-Type: application/json"
-H "TenantId: your-tenant-id"
-d '{ "to": "recipient@example.com", "subject": "Test Email", "body": "This is a test email sent from Email Queue Manager." }'

Frontend:

Log in with the credentials (admin/123qwe). Navigate to the "Email Queue" section. Fill in the email details (recipient, subject, body) and submit.

Checking Email Queue Status

Use the API to check the queue:curl http://localhost:5000/api/emails/queue

In the frontend, view the queue status in the "Queue Dashboard" section.

Handling Failed Emails

Failed emails are logged and can be viewed via: API: GET /api/emails/failed Frontend: "Failed Emails" tab in the dashboard.

Retry failed emails manually or configure automatic retries in appsettings.json.

Contributing We welcome contributions to improve Email Queue Manager! To contribute:

Fork the repository. Create a new branch (git checkout -b feature/your-feature). Commit your changes (git commit -m "Add your feature"). Push to the branch (git push origin feature/your-feature). Open a pull request.

Please read our CONTRIBUTING.md for detailed guidelines. License This project is licensed under the MIT License. See the LICENSE file for details. Troubleshooting

Database Connection Issues: Ensure the connection string in appsettings.json is correct and the SQL Server is running. SMTP Errors: Verify SMTP credentials and network connectivity to the SMTP server. Frontend Not Loading: Ensure ng serve is running and there are no port conflicts on 4200.

Contact For questions or support, open an issue on the GitHub Issues page or contact the maintainer at your-email@example.com.

About

Email Sending using Asp.net core boilerplate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors