This project demonstrates how to use Hangfire and SendGrid to send newsletter emails in the background at a 2-minute interval.
- Background task processing using Hangfire
- Sending emails using SendGrid
- Configurable email interval
- Hangfire
- SendGrid
- Clone the repository:
git clone https://github.com/Matthew-Oduamafu/HangfireAndSendGrid.git
- Navigate to the project directory:
cd HangfireAndSendGrid
- Install dependencies:
dotnet restore
- Configure SendGrid API key:
- Open
appsettings.json
file - Replace
YOUR_SENDGRID_API_KEY
with your actual SendGrid API key or Add ApiKey to Environment variables
- Open
- Build the project:
dotnet build
- Run the project:
dotnet run
- Access the application at:
https://localhost:7256
- The newsletter emails will be sent automatically in the background at a 2-minute interval.
appsettings.json
: Contains configuration settings for Hangfire and SendGrid.