steve.pums.assess.process
Class EmailService

java.lang.Object
  extended by steve.pums.assess.process.EmailService

public class EmailService
extends java.lang.Object

Used for constructing and sending email messages from the SUMS marking system


Constructor Summary
EmailService(java.sql.Connection conn)
          Creates a new instance of EmailService
 
Method Summary
 void sendEmail(int[] to, java.lang.String messageKey, java.util.Map messageArgs)
          Sends an email with standardised subject and sender, loaded from application properties
 void sendEmail(int[] to, java.lang.String from, java.lang.String messageKey, java.lang.String messageSubject, java.util.Map messageArgs)
          Sends an email with the specified parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailService

public EmailService(java.sql.Connection conn)
Creates a new instance of EmailService

Parameters:
conn - Connection to the SUMS database
Method Detail

sendEmail

public void sendEmail(int[] to,
                      java.lang.String from,
                      java.lang.String messageKey,
                      java.lang.String messageSubject,
                      java.util.Map messageArgs)
               throws jim.common.JimFatalException,
                      java.sql.SQLException,
                      javax.mail.MessagingException
Sends an email with the specified parameters

Parameters:
to - array of person ids to send the email to
from - email address of sender
messageKey - identifier of the email template held in the SUMS database
messageSubject - email subject
messageArgs - values to insert in to the email template
Throws:
jim.common.JimFatalException - as a result of error in DB fetcher
java.sql.SQLException - as a result of an error in the address lookup
javax.mail.MessagingException - as a result of error in email sending

sendEmail

public void sendEmail(int[] to,
                      java.lang.String messageKey,
                      java.util.Map messageArgs)
               throws jim.common.JimFatalException,
                      java.sql.SQLException,
                      javax.mail.MessagingException
Sends an email with standardised subject and sender, loaded from application properties

Parameters:
to - array of person ids to send the email to
messageKey - identifier of the email template held in the SUMS database
messageArgs - values to insert in to the email template
Throws:
jim.common.JimFatalException - as a result of error in DB fetcher
java.sql.SQLException - as a result of an error in the address lookup
javax.mail.MessagingException - as a result of error in email sending