Table of Contents

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

sesClient IAmazonSimpleEmailServiceV2

The AWS SES client.

logger ILogger<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

fromAddress string

The sender email address (must be verified in SES).

fromName string

The sender display name.

toAddresses List<string>

List of recipient email addresses.

subject string

Email subject.

htmlBody string

HTML email body.

textBody string

Plain text email body (optional).

replyToAddresses List<string>

List of reply-to email addresses (optional).

configurationSet string

SES configuration set name (optional).

cancellationToken CancellationToken

Cancellation token.

Returns

Task<string>

The message ID from SES.

Exceptions

Exception

Thrown when SES API returns an error.