Table of Contents

Interface ISendGridApiKeyResolver

Namespace
Builvero.Application.Interfaces.Services
Assembly
Builvero.Application.dll

Defines the contract for resolving SendGrid API keys, supporting dynamic key retrieval from configuration or external sources.

public interface ISendGridApiKeyResolver

Remarks

This interface provides a method for resolving SendGrid API keys asynchronously. The implementation may retrieve the API key from configuration files, environment variables, or external key management services. This abstraction allows for flexible key management strategies without coupling the email sending logic to a specific configuration source.

Methods

ResolveApiKeyAsync(CancellationToken)

Resolves the SendGrid API key asynchronously.

Task<string> ResolveApiKeyAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<string>

The SendGrid API key string.

Remarks

The API key is required for all SendGrid email operations. If the key cannot be resolved, email sending operations will fail.

Exceptions

InvalidOperationException

Thrown when the API key cannot be resolved or is not configured.