TF-48 Create and update object for compose email

This commit is contained in:
dab246
2021-09-08 15:09:48 +07:00
committed by Dat H. Pham
parent 18d0206c44
commit db4d262a8c
20 changed files with 105 additions and 20 deletions
+43
View File
@@ -0,0 +1,43 @@
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
import 'package:model/model.dart';
extension EmailExtension on Email {
Set<String> getRecipientEmailAddressList() {
final listEmailAddress = Set<String>();
final listToAddress = to.getListAddress() ?? [];
final listCcAddress = cc.getListAddress() ?? [];
final listBccAddress = bcc.getListAddress() ?? [];
listEmailAddress.addAll(listToAddress + listCcAddress + listBccAddress);
return listEmailAddress;
}
EmailContent toEmailContent() {
return EmailContent(
id,
htmlBody: htmlBody,
attachments: attachments,
bodyValues: bodyValues
);
}
PresentationEmail toPresentationEmail({SelectMode selectMode = SelectMode.INACTIVE}) {
return PresentationEmail(
id,
keywords: keywords,
size: size,
receivedAt: receivedAt,
hasAttachment: hasAttachment,
preview: preview,
subject: subject,
sentAt: sentAt,
from: from,
to: to,
cc: cc,
bcc: bcc,
replyTo: replyTo,
selectMode: selectMode
);
}
}