|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.konakartadmin.bl.AdminBaseMgr
com.konakartadmin.bl.AdminEmailMgr
public class AdminEmailMgr
Manager for sending emails
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr |
---|
AdminBaseMgr.StaticData |
Field Summary | |
---|---|
protected java.lang.String |
imageBase
|
protected static org.apache.commons.logging.Log |
log
the log |
protected java.lang.String |
logFileDirectory
|
protected static java.lang.String |
NEW_PASSWORD_TEMPLATE
|
protected static java.lang.String |
ORDER_STATUS_CHANGE_TEMPLATE
|
protected java.lang.String |
pdfBase
|
protected java.lang.String |
storeName
|
protected java.lang.String |
storeOwner
|
protected java.lang.String |
storeOwnerEmailAddr
|
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr |
---|
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir |
Constructor Summary | |
---|---|
AdminEmailMgr(KKAdminIf eng)
Constructor |
Method Summary | |
---|---|
protected com.konakart.bl.EmailConfig |
getConfigData()
Return an EmailConfig object that contains attributes required to configure the eMail. |
com.konakart.bl.Emailer |
getEmailer()
|
protected javax.mail.Address |
getMailAddressFromString(java.lang.String addrString)
Return an Address for the specified String. |
protected org.apache.velocity.app.VelocityEngine |
getVelocityEngine()
Returns the Velocity engine |
protected void |
refreshPrivateConfigs()
Refresh the Configuration variables for this manager Setup variables needed to send the mail |
boolean |
sendEmail(AdminEmail adminEmailData)
To send an email |
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 deleteAttachmentAfterSend,
boolean async)
Send a HTML-only email message to the specified recipient, with the specified subject and HTML content. |
void |
sendNewPasswordEmail(java.lang.String emailAddr,
java.lang.String newPassword,
java.lang.String mailSubject,
java.lang.String countryCode)
Send out an email notifying a user of a new password |
void |
sendStatusChangeEmail(int orderId)
A status change email is sent when the status of an order is changed |
void |
sendStatusChangeEmailForState(int orderId,
int state)
A status change email is sent when the status of an order is changed. |
protected void |
sendStatusChangeEmailPrivate(int orderId,
int state)
A status change email is sent when the status of an order is changed. |
void |
sendTemplateEmail(AdminCustomer customer,
java.lang.String templateName,
java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3,
java.lang.Object obj4,
java.lang.Object obj5,
AdminEmailOptions options)
An email is sent to the customer. |
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 fromAddressString,
java.lang.String replyToAddressString,
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
protected java.lang.String storeOwner
protected java.lang.String storeName
protected java.lang.String storeOwnerEmailAddr
protected java.lang.String logFileDirectory
protected java.lang.String pdfBase
protected java.lang.String imageBase
protected static final java.lang.String NEW_PASSWORD_TEMPLATE
protected static final java.lang.String ORDER_STATUS_CHANGE_TEMPLATE
Constructor Detail |
---|
public AdminEmailMgr(KKAdminIf eng) throws java.lang.Exception
eng
- KKAdmin engine
java.lang.Exception
Method Detail |
---|
protected void refreshPrivateConfigs() throws java.lang.Exception
java.lang.Exception
public boolean sendEmail(AdminEmail adminEmailData) throws KKAdminException
sendEmail
in interface AdminEmailMgrIf
adminEmailData
- the Email object to fill out to define the email to send
KKAdminException
- typically when the email could not be sentpublic void sendNewPasswordEmail(java.lang.String emailAddr, java.lang.String newPassword, java.lang.String mailSubject, java.lang.String countryCode) throws java.lang.Exception
sendNewPasswordEmail
in interface AdminEmailMgrIf
emailAddr
- Email address to send to - the TO: addressnewPassword
- the new password that was randomly generatedmailSubject
- the email subject linecountryCode
- country code (to pick the appropriate velocity template)
java.lang.Exception
public void sendHTML(java.lang.String toAddressString, java.lang.String theSubject, java.lang.String theContentHTML, boolean doBlindCopy, boolean async) throws KKAdminException
sendHTML
in interface AdminEmailMgrIf
toAddressString
- the TO: addresstheSubject
- the subject line of the emailtheContentHTML
- the HTML body of the emaildoBlindCopy
- if true the defined Blind Copy address will be addedasync
- set to true to send the mail asynchronously or false to send it synchronously
KKAdminException
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 deleteAttachmentAfterSend, boolean async) throws KKAdminException
toAddressString
- the TO: addresstheSubject
- the subject line of the emailtheContentHTML
- the HTML body of the emaildoBlindCopy
- if true the defined Blind Copy address will be addedfullAttachmentFilename
- full filename of the attachmentfriendlyAttachmentName
- friendly name to use for the attachment * @param async set to true to send the
mail asynchronously or false to send it synchronouslydeleteAttachmentAfterSend
- async
-
KKAdminException
public void sendText(java.lang.String toAddressString, java.lang.String theSubject, java.lang.String theContentText, boolean doBlindCopy, boolean async) throws KKAdminException
sendText
in interface AdminEmailMgrIf
toAddressString
- the TO: addresstheSubject
- the subject line of the emailtheContentText
- the plain text body of the emaildoBlindCopy
- if true the defined Blind Copy address will be addedasync
- set to true to send the mail asynchronously or false to send it synchronously
KKAdminException
public void sendText(java.lang.String toAddressString, java.lang.String fromAddressString, java.lang.String replyToAddressString, java.lang.String theSubject, java.lang.String theContentText, boolean doBlindCopy, boolean async) throws KKAdminException
sendText
in interface AdminEmailMgrIf
toAddressString
- TO: addressfromAddressString
- From addressreplyToAddressString
- reply to addresstheSubject
- theContentText
- the plain text body of the emaildoBlindCopy
- if true the defined Blind Copy address will be addedasync
- set to true to send the mail asynchronously or false to send it synchronously
KKAdminException
public void sendStatusChangeEmailForState(int orderId, int state) throws java.lang.Exception
sendStatusChangeEmailForState
in interface AdminEmailMgrIf
orderId
- the order Id of the order whose status has changedstate
- the state of the order
java.lang.Exception
public void sendStatusChangeEmail(int orderId) throws java.lang.Exception
sendStatusChangeEmail
in interface AdminEmailMgrIf
orderId
- the order Id of the order whose status has changed
java.lang.Exception
protected void sendStatusChangeEmailPrivate(int orderId, int state) throws java.lang.Exception
orderId
- the order Id of the order whose status has changedstate
- the state of the order
java.lang.Exception
public com.konakart.bl.Emailer getEmailer() throws KKAdminException
getEmailer
in interface AdminEmailMgrIf
KKAdminException
protected com.konakart.bl.EmailConfig getConfigData() throws java.lang.Exception
java.lang.Exception
protected javax.mail.Address getMailAddressFromString(java.lang.String addrString) throws KKAdminException
addrString
- the address in String form
com.konakart.app.KKException
KKAdminException
public void sendTemplateEmail(AdminCustomer customer, java.lang.String templateName, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5, AdminEmailOptions options) throws java.lang.Exception
sendTemplateEmail
in interface AdminEmailMgrIf
customer
- The customer to which the eMail will be sent. It will be passed to the velocity
template with the name "cust".templateName
- The name of the template. The country code and .vm will be appended automatically.
i.e. If the template name is newsletter and the country code is en, then we will
look for a file called newsletter_en.vm. This file should be in the classpath.obj1
- This object will be passed to the velocity template with the name "obj1".obj2
- This object will be passed to the velocity template with the name "obj2".obj3
- This object will be passed to the velocity template with the name "obj3".obj4
- This object will be passed to the velocity template with the name "obj4".obj5
- This object will be passed to the velocity template with the name "obj5".options
- Email Options
java.lang.Exception
protected org.apache.velocity.app.VelocityEngine getVelocityEngine() throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |