public class SMTPDistributor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
Copyright.
|
Constructor and Description |
---|
SMTPDistributor(EmailJobKeeper jobKeeper,
boolean buildRec)
The SMTP distributor is a utility to deliver a bunch of email prepared inside Email Job Keeper,
For large volume of email, the email-sending will be split into multiple scheduler-job; and for
each scheduler-job, a new SMTPDistriubter will go to the Email Job Keeper to get the sending-job
(email template, email account info, etc) and a list of recipients that are scheduled for the
same schedule.
|
SMTPDistributor(EmailJobKeeper jobKeeper,
boolean buildRec,
boolean newIndividualEmail)
The SMTP distributor is a utility to deliver a bunch of email prepared inside Email Job Keeper,
For large volume of email, the email-sending will be split into multiple scheduler-job; and for
each scheduler-job, a new SMTPDistriubter will go to the Email Job Keeper to get the sending-job
(email template, email account info, etc) and a list of recipients that are scheduled for the
same schedule.
|
Modifier and Type | Method and Description |
---|---|
void |
distribute()
Distributes the PersonalizedEmailContent to the list of recipients, PersonalizedEmailContent & Email recipients are store in
the Email Job Keeper.
|
void |
distribute(PersonalizedEmailContent emailContent,
java.util.List emailRecipients)
Distributes the EmailContent to the list of recipients.
|
java.util.List |
getFailedRecipients()
Returns the list of EmailRecipient objects to which the message failed to be delivered.
|
java.util.List |
getSuccessfulRecipients()
Returns the list of EmailRecipient objects to which the message was successfully delivered.
|
public static final java.lang.String COPYRIGHT
public SMTPDistributor(EmailJobKeeper jobKeeper, boolean buildRec)
jobKeeper
- the Email Job Keeper will keep all info about a email-sending-job which may need
multiple schedule to finish it.buildRec
- the flag to tell if a recipient list (failed & succeeded) should be created
when sending the emailpublic SMTPDistributor(EmailJobKeeper jobKeeper, boolean buildRec, boolean newIndividualEmail)
jobKeeper
- the Email Job Keeper will keep all info about a email-sending-job which may need
multiple schedule to finish it.buildRec
- the flag to tell if a recipient list (failed & succeeded) should be created
when sending the emailnewIndividualEmail
- set to true if the e-mail is being sent to one individual customer.public void distribute() throws javax.mail.MessagingException
javax.mail.MessagingException
- Thrown when JavaMail throws a MessagingException
.public void distribute(PersonalizedEmailContent emailContent, java.util.List emailRecipients) throws javax.mail.MessagingException
emailContent
- the object representing the content of the email.emailRecipients
- list the recipients of the email.javax.mail.MessagingException
- Thrown when JavaMail throws a MessagingException
.public java.util.List getFailedRecipients()
public java.util.List getSuccessfulRecipients()