◆ SendAttachments()
org.turro.mail.recipients.SendAttachments.SendAttachments |
( |
String |
title | ) |
|
◆ addAttachment()
void org.turro.mail.recipients.SendAttachments.addAttachment |
( |
Object |
entity, |
|
|
String |
path, |
|
|
String |
name |
|
) |
| |
Definition at line 58 of file SendAttachments.java.
59 attachments.add(
new MailAttachment(path, name, entity));
◆ fillAttachment()
abstract void org.turro.mail.recipients.SendAttachments.fillAttachment |
( |
File |
attachment, |
|
|
Object |
entity |
|
) |
| |
|
abstractprotected |
◆ sendAttachments()
void org.turro.mail.recipients.SendAttachments.sendAttachments |
( |
Collection< IContact > |
contacts | ) |
throws IOException |
Definition at line 62 of file SendAttachments.java.
63 if(attachments.isEmpty()) {
66 IMailRecipients.selectRecipients(contacts,
new Command() {
68 public Object execute(Context context) {
69 IMailRecipients mr = (IMailRecipients) context.get(
"component");
70 Collection<IContact> contacts = mr.getRecipients();
71 if(contacts !=
null) {
72 String mailString = getMailString(contacts);
73 if(!Strings.isBlank(mailString)) {
74 for(MailAttachment ma : attachments) {
76 ma.attachment = File.createTempFile(
"attach_",
"_mail");
78 }
catch (IOException ex) {
79 Logger.getLogger(
SendAttachments.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(mailString), ex);
82 sendAttachments(contacts, attachments, IMailRecipients.getComment(), mailString, (m) -> {
83 for(MailAttachment ma : attachments) {
84 ma.attachment.delete();
85 SystemLogger.getInstance().doLog(SystemLogType.LOG_INFO, ma.path,
"sent", mailString);
abstract void fillAttachment(File attachment, Object entity)
void sendAttachments(Collection< IContact > contacts)
SendAttachments(String title)
The documentation for this class was generated from the following file: