com.konakart.bl
Class Emailer

java.lang.Object
  extended by com.konakart.bl.Emailer

public class Emailer
extends java.lang.Object

Emailer class.


Field Summary
protected static org.apache.commons.logging.Log log
          the log
 
Constructor Summary
Emailer(EmailConfig emailConfig)
          Constructor
Emailer(KKEngIf eng)
          Constructor
 
Method Summary
 ConfigurationMgr getConfigMgr()
           
protected  EmailIntegrationMgrInterface getEmailIntegrationMgr()
          Used to get an instance of the EmailIntegrationMgr
 java.lang.String getSubject()
           
 javax.mail.Address getToAddress()
           
static boolean isEmailValid(java.lang.String emailAddr)
          Determines whether the eMail address is valid
 void refreshConfigs()
          Setup variables needed to send the mail
protected  void send()
          Send an email message that has been fully defined before this call.
 void sendHTML(java.lang.String toAddressString, java.lang.String theSubject, java.lang.String theContentHTML, boolean doBlindCopy, boolean async)
          Send a HTML-only email message to the specified recipient, with the specified subject and HTML content.
 void sendHTML(java.lang.String toAddressString, java.lang.String theSubject, java.lang.String theContentHTML, boolean doBlindCopy, java.lang.String fullAttachmentFilename, java.lang.String friendlyAttachmentName, boolean delAttachmentAfterSend, boolean async)
          Send a HTML-only email message to the specified recipient, with the specified subject and HTML content.
 void sendMail(boolean async)
          Send the mail either synchronously or asynchronously
 void sendText(java.lang.String toAddressString, java.lang.String theSubject, java.lang.String theContentText, boolean doBlindCopy, boolean async)
          Send a text-only email message to the specified recipient, with the specified subject and text content.
 void sendText(java.lang.String toAddressString, java.lang.String fromAddress, java.lang.String replyToAddress, java.lang.String theSubject, java.lang.String theContentText, boolean doBlindCopy, boolean async)
          Send a text-only email message to the specified recipient, with the specified fromAddress, replyToAddress, subject and text content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log

Constructor Detail

Emailer

public Emailer(KKEngIf eng)
        throws java.lang.Exception
Constructor

Parameters:
eng -
Throws:
java.lang.Exception

Emailer

public Emailer(EmailConfig emailConfig)
        throws java.lang.Exception
Constructor

Parameters:
emailConfig - Object containing configuration parameters
Throws:
java.lang.Exception
Method Detail

refreshConfigs

public void refreshConfigs()
                    throws java.lang.Exception
Setup variables needed to send the mail

Throws:
java.lang.Exception

sendHTML

public void sendHTML(java.lang.String toAddressString,
                     java.lang.String theSubject,
                     java.lang.String theContentHTML,
                     boolean doBlindCopy,
                     boolean async)
              throws KKException
Send a HTML-only email message to the specified recipient, with the specified subject and HTML content.

Parameters:
toAddressString -
theSubject -
theContentHTML -
doBlindCopy -
async -
Throws:
KKException

sendHTML

public void sendHTML(java.lang.String toAddressString,
                     java.lang.String theSubject,
                     java.lang.String theContentHTML,
                     boolean doBlindCopy,
                     java.lang.String fullAttachmentFilename,
                     java.lang.String friendlyAttachmentName,
                     boolean delAttachmentAfterSend,
                     boolean async)
              throws KKException
Send a HTML-only email message to the specified recipient, with the specified subject and HTML content.

Parameters:
toAddressString -
theSubject -
theContentHTML -
doBlindCopy -
fullAttachmentFilename - full filename of the attachment
friendlyAttachmentName - friendly name to use for the attachment
delAttachmentAfterSend - set to true to delete the attachment file after the send
async -
Throws:
KKException

sendText

public void sendText(java.lang.String toAddressString,
                     java.lang.String theSubject,
                     java.lang.String theContentText,
                     boolean doBlindCopy,
                     boolean async)
              throws KKException
Send a text-only email message to the specified recipient, with the specified subject and text content.

Parameters:
toAddressString -
theSubject -
theContentText -
doBlindCopy -
async -
Throws:
KKException

sendText

public void sendText(java.lang.String toAddressString,
                     java.lang.String fromAddress,
                     java.lang.String replyToAddress,
                     java.lang.String theSubject,
                     java.lang.String theContentText,
                     boolean doBlindCopy,
                     boolean async)
              throws KKException
Send a text-only email message to the specified recipient, with the specified fromAddress, replyToAddress, subject and text content.

Parameters:
toAddressString -
fromAddress -
replyToAddress -
theSubject -
theContentText -
doBlindCopy -
async -
Throws:
KKException

sendMail

public void sendMail(boolean async)
              throws KKException
Send the mail either synchronously or asynchronously

Parameters:
async -
Throws:
KKException

send

protected void send()
             throws KKException
Send an email message that has been fully defined before this call.

Throws:
KKException

getConfigMgr

public ConfigurationMgr getConfigMgr()
                              throws java.lang.Exception
Returns:
Returns the configMgr creating one if it doesn't exist.
Throws:
java.lang.Exception

isEmailValid

public static boolean isEmailValid(java.lang.String emailAddr)
Determines whether the eMail address is valid

Parameters:
emailAddr -
Returns:
Returns true if the email address is valid. Otherwise returns false.

getEmailIntegrationMgr

protected EmailIntegrationMgrInterface getEmailIntegrationMgr()
                                                       throws org.apache.torque.TorqueException,
                                                              KKException,
                                                              com.workingdogs.village.DataSetException,
                                                              java.lang.Exception
Used to get an instance of the EmailIntegrationMgr

Returns:
Returns an EmailIntegrationMgr Object
Throws:
java.lang.Exception
com.workingdogs.village.DataSetException
KKException
org.apache.torque.TorqueException

getSubject

public java.lang.String getSubject()
Returns:
the subject

getToAddress

public javax.mail.Address getToAddress()
Returns:
the toAddress


Copyright © 2011 DS Data Systems UK Ltd.