sendFromTemplateFile method

Future<SendReport> sendFromTemplateFile(
  1. Message message,
  2. String templateFilePath,
  3. Map<String, String> values
)

this will convert the email template into a message content don't add text or html because they will be replaced by the template template file can be in any format, html, txt or whatever template value should be on format </valueKeyHere/> and you just need to replace the valueKeyHere with the actual value in the values object in this function

Implementation

Future<SendReport> sendFromTemplateFile(
  Message message,
  String templateFilePath,
  Map<String, String> values,
) async {
  File file = File(templateFilePath);
  if (!file.existsSync()) {
    throw TemplateNotFoundException();
  }
  String fileContent = await file.readAsString();
  return sendFromTemplateText(message, fileContent, values);
}