19 package org.turro.newsletter.mail;
21 import java.io.IOException;
22 import java.util.Collection;
23 import java.util.logging.Level;
24 import java.util.logging.Logger;
25 import org.apache.commons.mail.EmailException;
26 import org.turro.action.Contacts;
27 import org.turro.action.IAgreements;
28 import org.turro.action.Plugins;
29 import org.turro.action.queue.NotificationCategory;
30 import org.turro.action.queue.Notifications;
31 import org.turro.action.queue.QueuePeriod;
32 import org.turro.assistant.Assistant;
33 import org.turro.assistant.AssistantSet;
34 import org.turro.elephant.context.Application;
35 import org.turro.elephant.context.ElephantContext;
36 import org.turro.elephant.entities.db.QueueOptions;
37 import org.turro.mail.message.MailMessageTemplate;
38 import org.turro.mail.pool.MailMessagePool;
39 import org.turro.mail.provider.MailProviders;
40 import org.turro.mail.queue.QueueManager;
41 import org.turro.mail.queue.QueuedSender;
42 import org.turro.newsletter.NewsletterTemplate;
43 import org.turro.plugin.contacts.IContact;
44 import org.turro.publication.entity.Newsletter;
55 this.newsletter = newsletter;
66 if(assistant.getContact().acceptsLang(newsletter.
getLang())) {
71 if(newsletter.
trigger(assistant.getContact())) {
76 }
catch (IOException | EmailException ex) {
static< T > T loadImplementation(Class< T > jclass)
static NotificationCategory getCategory(String id)
void addContact(IContact contact, Object relationEntity)
IConstructor getConstructor()
static Application getApplication()
static String logMsg(String msg)
MailMessage addToPool(String from, String to, String cc, String subject, String message)
static MailProviders instance()
MailMessagePool getPool(IConstructor constructor, String name)
Collection< QueueOptions > getSubcribers(String idCategory)
NewsletterSendToSubscribers(Newsletter newsletter)
void resetGlobalContext()
boolean trigger(IContact contact)
boolean canSendEmails(NotificationCategory nc)
void setContact(IContact contact)