sendEmail method
Future<bool>
sendEmail(
- String subject,
- String bodyHtml,
- String bodyText,
- Iterable<
MailAddress> recipients, { - Map<
String, MailerAttachment> images = const {}, - Map<
String, MailerAttachment> attachments = const {}, - Iterable<
MailAddress> replyTo = const [],
Implementation
Future<bool> sendEmail(
String subject,
String bodyHtml,
String bodyText,
Iterable<MailAddress> recipients,
{
Map<String, MailerAttachment> images = const {},
Map<String, MailerAttachment> attachments = const {},
Iterable<MailAddress> replyTo = const []
}
) async {
var type = config.getRequired<String>('mailer.type');
if (type == 'smtp') {
return await _sendSmtpEmail(subject, bodyHtml, bodyText, recipients, replyTo: replyTo, images: images, attachments: attachments);
} else if (type == 'print') {
return await _printEmail(subject, bodyText, recipients, replyTo: replyTo, images: images, attachments: attachments);
} else {
throw Exception('undefined mailer type');
}
}