sendEmailAndConfirm method
Send email and return sent confirmation
Sister method for standard sendEmail
method with the benefit of returning a SentEmail
entity confirming the successful sending of the email with a link to the sent object created for it.
Parameters:
-
String inboxId (required): ID of the inbox you want to send the email from
-
SendEmailOptions sendEmailOptions (required):
Implementation
Future<SentEmailDto?> sendEmailAndConfirm(String inboxId, SendEmailOptions sendEmailOptions,) async {
final response = await sendEmailAndConfirmWithHttpInfo(inboxId, sendEmailOptions,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SentEmailDto',) as SentEmailDto;
}
return null;
}