subscribeToEmailMessages

suspend fun SudoEmailClient.subscribeToEmailMessages(id: String, onConnectionChange: (status: Subscriber.ConnectionState) -> Unit = {}, onEmailMessageChanged: (emailMessage: EmailMessage, type: EmailMessageSubscriber.ChangeType) -> Unit)

Subscribes to be notified of new and deleted EmailMessages.

Parameters

id

String Unique identifier for the subscriber.

onConnectionChange

Lambda that is called when the subscription connection state changes.

onEmailMessageChanged

Lambda that receives updates as EmailMessages are modified.