19 package org.turro.mail.queue;
21 import java.util.Date;
22 import java.util.logging.Level;
23 import java.util.logging.Logger;
24 import org.turro.string.Strings;
25 import org.apache.commons.mail.EmailException;
26 import org.turro.action.IAgreements;
27 import org.turro.action.Plugins;
28 import org.turro.action.queue.NotificationCategory;
29 import org.turro.action.queue.Notifications;
30 import org.turro.action.queue.QueuePeriod;
31 import org.turro.elephant.context.ElephantContext;
32 import org.turro.elephant.context.IConstructor;
33 import org.turro.elephant.entities.db.MailItem;
34 import org.turro.elephant.security.IUser;
35 import org.turro.i18n.I_;
36 import org.turro.mail.message.MailMessageTemplate;
37 import org.turro.mail.pool.MailMessagePool;
38 import org.turro.mail.provider.MailProviders;
39 import org.turro.marker.ElephantMarker;
40 import org.turro.plugin.contacts.IContact;
41 import org.turro.util.CompareUtil;
55 this.constructor = constructor;
56 this.manager = manager;
64 for(String category : cm.keySet()) {
78 em.
put(
"contact", contact);
79 em.
put(
"messages", mis);
80 em.
put(
"notifier",
this);
86 }
catch (EmailException | NullPointerException ex) {
103 private transient String reason, subject;
104 private transient Date itemDate;
107 int result = CompareUtil.compare(reason, mailItem.
getReason());
121 int result = CompareUtil.compareDate(itemDate, mailItem.
getItemDate());
123 result = CompareUtil.compare(subject, mailItem.
getSubject());
static< T > T loadImplementation(Class< T > jclass)
static NotificationCategory getCategory(String id)
static String getSiteName()
static String logMsg(String msg)
static String get(String msg)
void setMessage(ElephantMarker marker, IContact contact)
static MailMessageTemplate of(MailProvider provider)
void setRoot(String root)
Email addTo(String email, String name)
void setSubject(String subject)
MailMessage addToPool(String from, String to, String cc, String subject, String message)
MailProvider getProvider()
static MailProviders instance()
static final String GENERIC
MailMessagePool getPool(IConstructor constructor, String name)
void removeMails(QueuePeriod period, String idContact, String idCategory)
Object put(Object key, Object value)
boolean canSendEmails(NotificationCategory nc)
void sendIfNecessary(IConstructor constructor)
void setContact(IContact contact)
boolean declinedNotifications()
static final String CONNECTOR_EMAIL