sendEmailFromTemplate method
Implementation
Future<MessageStatus?> sendEmailFromTemplate(
String templateName, EmailEnvelope envelope,
{Map<String, String>? templateValues, List<String>? attachments}) async {
Map<String, dynamic> parameters = {
'templateName': templateName,
'addressed': envelope.to,
'cc-addresses': envelope.cc,
'bcc-addresses': envelope.bcc,
'criteria': envelope.query,
'uniqueEmails': envelope.uniqueEmails,
};
if (attachments?.isNotEmpty ?? false) {
parameters['attachments'] = attachments;
}
if (templateValues?.isNotEmpty ?? false) {
parameters['template-values'] = templateValues;
}
return await Invoker.post('/emailtemplate/send', parameters);
}