63 this.constructor = constructor;
64 if(ElephantMarker.existsTemplate(constructor,
true,
"envelope",
"header")) {
65 MailMessagePool pool = MailProviders.instance().getPool(constructor,
"Publication");
67 List<MailAttachment> attached = getAttached(entity);
68 for(Assistant assistant : assistants) {
70 MailMessageTemplate mmt = MailMessageTemplate.of(pool.getProvider());
71 mmt.setRoot(
"/publications");
72 mmt.setSubject(entity.getTitle()+
" - " + ElephantContext.getSiteName());
73 mmt.addTo(assistant.email, assistant.name);
74 ElephantMarker em =
new ElephantMarker(constructor,
true);
75 ArrayList<Publication> pubs =
new ArrayList<>();
78 em.put(
"contact", assistant.contact);
79 em.put(
"email", assistant.email);
80 em.put(
"notifier",
this);
81 mmt.setMessage(em,
"sendable", assistant.contact);
82 for(MailAttachment ma : attached) {
83 mmt.attach(ma.getPath(), ma.getName(), ma.getName());
87 if(checkSent) Sendables.delivered(sendable.getEntityPath(), assistant.contact.getId());
88 }
catch (EmailException | NullPointerException ex) {
89 Logger.getLogger(
PublicationSendable.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
PublicationSendable(Publication entity)