Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

{indent:2} h5. *
3.2.1
EmailModel
*

This

is

the

domain

class

that

represents

an

Email

Message

object.

It

contains

the

following

fields:

#

  1. emailFrom
  1. the
  1. email
  1. address
  1. of
  1. the
  1. sender
#
  1. emailSubject
  1. the
  1. subject
  1. of
  1. the
  1. email
#
  1. emailTos
  1. the
  1. list
  1. of
  1. email
  1. addresses
  1. of
  1. those
  1. who
  1. will
  1. be
  1. sent
  1. a
  1. copy
  1. of
  1. the
  1. email
#
  1. emailCC
  1. the
  1. list
  1. of
  1. email
  1. addresses
  1. of
  1. those
  1. will
  1. get
  1. a
  1. cc
  1. copy
  1. of
  1. the
  1. email.
#
  1. emailBcc
  1. the
  1. list
  1. of
  1. email
  1. addresses
  1. of
  1. those
  1. will
  1. get
  1. a
  1. bcc
  1. copy
  1. of
  1. the
  1. email.
#
  1. emailReportRecipient
  1. the
  1. list
  1. of
  1. email
  1. addresses
  1. of
  1. those
  1. who
  1. will
  1. get
  1. a
  1. copy
  1. of
  1. the
  1. summary
  1. report.
#
  1. emailText
  1. the
  1. content
  1. of
  1. the
  1. email.
Panel

3. Object Model

3.1 Class Diagram

A new domain class EmailModel will be created to hold all the fields in an email message.
This diagram represents the domain class EmailModel.

3.2 Class Description.

indent
indent
33
Panel

4. Service Modules

indent
1
1
h4. *4.1 Class Diagram*
indent
22
!worddav2b7be35577f59c56701a08c35855344b.png|height=857,width=606!
indent
11
h4. *4.2 Class Descriptions.*
indent
22
h5. *4.2.1 EmailCentralService Interface*
indent
33
This is the interface that defines the methods available for the other web applications to utilize when they are required 
to send out emails to a single or a list of recipients. The service includes the following methods:
indent
44
{color:#000091}public{color} {color:#910091}void{color} sendBulkEmail(EmailModel emailModel)
{color:#000091}public{color} {color:#910091}void{color} sendBulkEmailWithTemplate(EmailModel emailModel, String velocityTemplate, Map context)
{color:#000091}public{color} {color:#910091}Map<String, Integer>{color} sendBulkEmailWithCounts(EmailModel emailModel)
{color:#000091}public{color} {color:#910091}Map<String, Object>{color} generateEmailPreviewWithTemplate(EmailModel emailModel, String type, String velocityTemplate, Map context)
public {color:#910091}Map<String, Object>{color} generateSummaryReportPreview(EmailModel emailModel)
{color:#000091}public{color} {color:#910091}void{color} newEmail(String velocityTemplate, Map context, String to, String from, String subject, boolean html)
{color:#000091}public{color} {color:#910091}void{color} newEmail(String velocityTemplate, Map context, String\[\] tos, String from, String subject, boolean html)
{color:#000091}public{color} {color:#910091}void{color} newEmail(String velocityTemplate, Map context, String to, String subject, boolean html)
{color:#000091}public{color} {color:#910091}void{color} newEmail(String velocityTemplate, Map context, String\[\] tos, String subject, boolean html)
{color:#000091}public{color} {color:#910091}void{color} newEmail(String body, String to, String subject, boolean html)
{color:#000091}public{color} {color:#910091}void{color} newEmail(String from, String\[\] to, String subject, String body, String\[\] cc, String\[\] bcc, String\[\] rr)
{color:#000091}public{color} {color:#910091}List{color} getMessageQueue()
public {color:#910091}void{color} batchSend()
public {color:#910091}boolean{color} validateEmailAddress(String emailAddress)
indent
33
h5. *4.2.3 EmailCentralService Implementation*
indent
44
This is the implementation class for the EmailCentralService. It contains an EmailService object (in csf common-legacy module) to 
perform its tasks.
indent
44
h6. *4.2.3.1 sendBulkEmail*
{indent:5}
This method obtains an EmailModelDomain Object. It will then process the data and call the newEmail method to send the email and 
the summary report to the intended recipients. The call to the newEmail method should be configured with the following parameters:
\\
newEmail(String from, String\[\] to, String subject, String body, String\[\] cc, String\[\] bcc, String\[\] rr);
The following attributes in the EmailModel Object will affect the generation of email:

# a list of email addresses of the recipients specified in the "To" field <required>
# a list of email addresses of the recipients specified in the "cc" field <optional>
# a list of email addresses of the recipients specified in the "Bcc" field <optional>
# a list of email addresses of the recipients speicified in the "Report Recipient" field <optional>
# email subject<optional>
# email text <required>
indent
44
h6. *4.2.3.2 sendBulkEmailWithTemplate*
indent
55
This method obtains an EmailModel Object, a velocity template name and a map that contains the values for the variables in the template. 
It will use the velocity template and the map to generate the text for the email. Then, it will call the sendBulkEmail method to send 
the email message and the summary report to intended recipients.
indent
44
h6. *4.2.3.3 sendBulkEmailWithCounts*
indent
55
This method obtains an EmailModel Object. It will call the sendBulkEmail method to send the email message and the summary report to intended
recipients. Then, it will call the BatchSend to send out the email and return the counts of successful and failed delivery.
indent
44
h6. *4.2.3.4 generateEmailPreviewWithTemplate*
indent
55
This method obtains an EmailModel Object, a string to specify the type of preview, a velocity template name, and a Map that contains the values 
for the variables within the velocity template. It will use the velocity template and the map to generate the text for the email. Then, it will 
updated the email test to the email model object and put the updated object into the returned Map. If a summary report preview is required, it 
will call the generateSummaryReportPreview method to add the attributes necessary to generate the summary report preview to the returned map.
indent
44
h6. *4.2.3.5 generateSummaryReportPreview*
indent
55
This private method adds the objects/attributes necessary to create a preview of the summary report. The objects to be added are as follows:
# A String that contains the content of the summary report
indent
44
h6. *4.2.3.6 newEmail*
indent
55
These sets of methods are the same public methods available in the EmailService in the CSF common-legacy module. 
indent
44
h6. *4.2.3.7 prepare*
indent
55
These 3 methods are static public methods available in the EmailService in the CSF common-legacy module.
indent
44
h6. *4.2.3.8 getMessageQueue*
indent
55
This method is a public method migrated over from the EmailServiceImpl in common-legacy module.
indent
4
4
h6. *4.2.3.9 batchSend*
indent
5
5
This method is a public method migrated over from the EmailServiceImpl in common-legacy module. 
indent
4
4
h6. 4.2.3.10 createReportRecipientContent*
indent
5
5
This method is a public method migrated over from the EmailServiceImpl in common-legacy module.
indent
4
4
h6. *4.2.3.11 createMessage*
indent
5
5
This method is a public method migrated over from the EmailServiceImpl in common-legacy module.
indent
4
4
h6. *4.2.3.12 sendMessage*
indent
5
5
These methods are public methods that are migrated over from the EmailServiceImpl in common-legacy module.
indent
4
4
h6. *4.2.3.13 validateEmailAddress*
indent
5
5
This method takes an input of email address in String and validate if the email address is valid. If the email address is valid, it will return 
true. If not, it will return false. The input email address is validated according to the following conditions:
# The system will create a new InternetAddress object using the input email address and then invoke the validate method of the InternetAddress object to verify it is a real email address