sendSimpleEmail method
Convenience wrapper for sending a basic email with string addresses.
Example:
final response = await client.sendSimpleEmail(
from: 'noreply@example.com',
to: ['jane@example.com'],
subject: 'Hello',
body: 'Plain text body',
htmlBody: '<p>Plain text body</p>',
);
Implementation
Future<SendEmailResponse> sendSimpleEmail({
required String from,
required List<String> to,
required String subject,
String? body,
String? htmlBody,
List<String>? cc,
List<String>? bcc,
}) async {
final emailRequest = SendEmailRequest(
from: EmailAddress(from),
to: to.map((e) => EmailAddress(e)).toList(),
cc: cc?.map((e) => EmailAddress(e)).toList(),
bcc: bcc?.map((e) => EmailAddress(e)).toList(),
subject: subject,
textBody: body,
htmlBody: htmlBody,
);
return sendEmail(emailRequest);
}