Class SesClient
- Namespace
- Builvero.Infrastructure.Services
- Assembly
- Builvero.Infrastructure.dll
AWS SES client wrapper implementation.
public class SesClient : ISesClient
- Inheritance
-
SesClient
- Implements
- Inherited Members
Remarks
This class wraps the AWS SES SDK to provide a testable interface.
Constructors
SesClient(IAmazonSimpleEmailServiceV2, ILogger<SesClient>)
Initializes a new instance of the SesClient class.
public SesClient(IAmazonSimpleEmailServiceV2 sesClient, ILogger<SesClient> logger)
Parameters
sesClientIAmazonSimpleEmailServiceV2The AWS SES client.
loggerILogger<SesClient>Logger for recording operations.
Methods
SendEmailAsync(string, string?, List<string>, string, string, string?, List<string>?, string?, CancellationToken)
Sends an email using AWS SES.
public Task<string> SendEmailAsync(string fromAddress, string? fromName, List<string> toAddresses, string subject, string htmlBody, string? textBody = null, List<string>? replyToAddresses = null, string? configurationSet = null, CancellationToken cancellationToken = default)
Parameters
fromAddressstringThe sender email address (must be verified in SES).
fromNamestringThe sender display name.
toAddressesList<string>List of recipient email addresses.
subjectstringEmail subject.
htmlBodystringHTML email body.
textBodystringPlain text email body (optional).
replyToAddressesList<string>List of reply-to email addresses (optional).
configurationSetstringSES configuration set name (optional).
cancellationTokenCancellationTokenCancellation token.
Returns
Exceptions
- Exception
Thrown when SES API returns an error.