This repository contains a .NET 8 library for sending emails using the SendGrid API. The client includes a retry mechanism to handle transient failures and ensures reliable email delivery.
The SendGrid Client is designed to integrate with .NET applications, providing a robust solution for sending emails via the SendGrid API. The implementation includes a retry mechanism to handle network failures or temporary issues with the SendGrid service.
- Send Emails: Send emails with plain text or HTML content.
- Retry Mechanism: Automatically retries failed requests with exponential backoff.
- Backend: .NET 8
- Email Sending: SendGrid API
- HTTP Client: RestSharp
- Dependency Injection: Used for service registrations and configurations
- Register the SendGridClient: Use the
RegisterSendGridClient
method inDepInj
to register the client in the dependency injection container. - Send Emails: Use the
SendEmailAsync
method from theISendGridClient
to send emails with a retry mechanism.
- ApiKey: The API key for SendGrid.
public class SendGridOptions
{
public string ApiKey { get; set; }
}