toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> map = <String, dynamic>{
'subject': subject,
'body': body,
'recipients': recipients,
'ccRecipients': ccRecipients,
'bccRecipients': bccRecipients,
'isHTML': isHTML,
'appSchema': appSchema,
};
if (appSchema != null && appSchema!.isNotEmpty) {
map['appSchema'] = appSchema;
}
if (attachments.isNotEmpty) {
final List<String> paths = <String>[];
for (String path in attachments) {
if (path.isNotEmpty) {
paths.add(path);
}
}
map['attachments'] = paths;
}
return map;
}