◆ NewsletterSendToSubscribers()
org.turro.newsletter.mail.NewsletterSendToSubscribers.NewsletterSendToSubscribers |
( |
Newsletter |
newsletter | ) |
|
◆ doSend()
void org.turro.newsletter.mail.NewsletterSendToSubscribers.doSend |
( |
| ) |
|
|
protected |
Reimplemented from org.turro.mail.queue.QueuedSender.
Definition at line 59 of file NewsletterSendToSubscribers.java.
60 AssistantSet assistants = getAssistants();
61 MailMessagePool pool = MailProviders.instance().getPool(Application.getApplication().getConstructor(),
"Publication");
63 IAgreements agreements = Plugins.loadImplementation(IAgreements.class,
"agreements");
64 NotificationCategory nc = Notifications.getCategory(newsletter.
getIdCategory());
65 for(Assistant assistant : assistants) {
66 if(assistant.getContact().acceptsLang(newsletter.
getLang())) {
67 agreements.setContact(assistant.getContact());
68 if(agreements.canSendEmails(nc)) {
69 try (NewsletterTemplate nt =
new NewsletterTemplate(newsletter)) {
70 MailMessageTemplate mmt = nt.getMailMessage(pool, assistant.getContact());
71 if(newsletter.
trigger(assistant.getContact())) {
76 }
catch (IOException | EmailException ex) {
NewsletterSendToSubscribers(Newsletter newsletter)
void resetGlobalContext()
boolean trigger(IContact contact)
The documentation for this class was generated from the following file: