BrightSide Workbench Full Report + Source Code
org.turro.entities.NewsletterSendable Class Reference
Inheritance diagram for org.turro.entities.NewsletterSendable:
Collaboration diagram for org.turro.entities.NewsletterSendable:

Public Member Functions

 NewsletterSendable (Newsletter entity)
 
 NewsletterSendable (String entityPath)
 
- Public Member Functions inherited from org.turro.sendable.AbstractSendable< T >
 AbstractSendable (T entity)
 
 AbstractSendable (String entityPath)
 
Date getSchedule ()
 
boolean isSent ()
 
AssistantSet getAssistants ()
 
void send (IConstructor constructor)
 
void send (IConstructor constructor, Collection< IContact > contacts)
 

Protected Member Functions

boolean doSend (Sendable sendable, Newsletter entity, IConstructor constructor, AssistantSet assistants, boolean checkSent)
 
void addAssistants (AssistantSet as, Newsletter entity)
 
- Protected Member Functions inherited from org.turro.sendable.AbstractSendable< T >
abstract boolean doSend (Sendable sendable, T entity, IConstructor constructor, AssistantSet assistants, boolean checkSent)
 
abstract void addAssistants (AssistantSet as, T entity)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 44 of file NewsletterSendable.java.

Constructor & Destructor Documentation

◆ NewsletterSendable() [1/2]

org.turro.entities.NewsletterSendable.NewsletterSendable ( Newsletter  entity)

Definition at line 46 of file NewsletterSendable.java.

46  {
47  super(entity);
48  }

◆ NewsletterSendable() [2/2]

org.turro.entities.NewsletterSendable.NewsletterSendable ( String  entityPath)

Definition at line 50 of file NewsletterSendable.java.

50  {
51  super(entityPath);
52  }

Member Function Documentation

◆ addAssistants()

void org.turro.entities.NewsletterSendable.addAssistants ( AssistantSet  as,
Newsletter  entity 
)
protected

Definition at line 76 of file NewsletterSendable.java.

76  {
77  // do nothing
78  }

◆ doSend()

boolean org.turro.entities.NewsletterSendable.doSend ( Sendable  sendable,
Newsletter  entity,
IConstructor  constructor,
AssistantSet  assistants,
boolean  checkSent 
)
protected

Definition at line 55 of file NewsletterSendable.java.

55  {
56  if(ElephantMarker.existsTemplate(constructor, true, "envelope", "header")) {
57  MailMessagePool pool = MailProviders.instance().getPool(constructor, "Publication");
58  if(pool != null) {
59  for(Assistant assistant : assistants) {
60  try (NewsletterTemplate nt = new NewsletterTemplate(entity)) {
61  MailMessageTemplate mmt = nt.getMailMessage(pool, assistant.getContact());
62  pool.addToPool(mmt);
63  pool.sendPool();
64  if(checkSent) Sendables.delivered(sendable.getEntityPath(), assistant.contact.getId());
65  } catch (IOException | EmailException ex) {
66  Logger.getLogger(NewsletterSendable.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
67  }
68  }
69  entity.resetGlobalContext();
70  }
71  }
72  return checkSent;
73  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: