Table of Contents

Interface ISendGridClientWrapper

Namespace
Builvero.Infrastructure.Services
Assembly
Builvero.Infrastructure.dll

Wrapper interface for SendGrid client to enable dependency injection and testing.

public interface ISendGridClientWrapper

Remarks

This abstraction allows the SendGrid client to be mocked in unit tests and provides a consistent interface for sending emails through SendGrid's API.

Methods

SendEmailAsync(SendGridMessage, CancellationToken)

Sends an email using SendGrid's API.

Task<Response> SendEmailAsync(SendGridMessage message, CancellationToken cancellationToken = default)

Parameters

message SendGridMessage

The SendGrid message to send, including recipient, template, and dynamic data.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<Response>

The SendGrid API response containing status code and response body.