toMap method
Implementation
Map<String, dynamic> toMap() => {
"from": from?.toMap(),
"to": to == null ? [] : List<Map>.from(to!.map((x) => x.toMap())),
"cc": cc == null ? [] : List<Map>.from(cc!.map((x) => x.toMap())),
"bcc": bcc == null ? [] : List<Map>.from(bcc!.map((x) => x.toMap())),
"subject": subject,
"body": body,
"headers": headers ?? {},
"text": text ?? '',
"attachments": attachments == null
? []
: List<Map>.from(attachments!.map((x) => x.toMap())),
"category": category,
"variables": variables ?? {},
"tags": tags ?? {},
};