queue method

Future<void> queue()

Queue the mail for later

Implementation

Future<void> queue() async {
  try {
    validate();

    final html = await FlintTemplateEngine().render(view, data: data);
    final text = _stripHtmlTags(html);

    final mail = Mail().toMany(to).subject(subject).html(html).text(text);

    await mail.queue();
    print('📬 View mail queued for: ${to.join(', ')}');
  } catch (e) {
    print('❌ Failed to queue view mail: $e');
    rethrow;
  }
}