sendEmailFlow

fun <R> <Error class: unknown class>.sendEmailFlow(upstream: Flow<SesRequest<R>>, concurrency: Int = 1): Flow<SesResponse<*>>

Sends a flow of email requests using the AWS Simple Email Service (SES) client.

This extension function on SesClient takes an upstream Flow of SesRequest objects, processes them concurrently, and emits a Flow of SesResponse objects corresponding to the results of the email sending operations.

The function supports different types of SES requests, including bulk templated, raw, single, and single templated emails.

Return

A Flow of SesResponse objects, each representing the outcome of an email sending request.

Example usage:

val sesClient = SesClient { region = "us-east-1" }
val emailRequestsFlow = flowOf(
SesRequest.SingleTemplated(SesSingleTemplatedRequest(...)),
SesRequest.BulkTemplated(SesBulkTemplatedRequest(...)),
// more requests
)

val emailResponsesFlow = sesClient.sendEmailFlow(emailRequestsFlow, concurrency = 2)

emailResponsesFlow
.collect { response ->
// Handle each response
}

Parameters

R

The type parameter representing the payload type of the SesRequest.

upstream

A Flow of SesRequest objects that represent the email sending requests.

concurrency

An integer defining the level of concurrency for processing the requests. Default is 1, meaning sequential processing.