sendEmail method

Future<bool> sendEmail(
  1. String subject,
  2. String bodyHtml,
  3. String bodyText,
  4. Iterable<MailAddress> recipients, {
  5. Map<String, MailerAttachment> images = const {},
  6. Map<String, MailerAttachment> attachments = const {},
  7. 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');
  }
}