public class BaseMailModule extends BaseModule
Modifier and Type | Field and Description |
---|---|
protected com.konakartadmin.app.AdminCustomer |
adminCustomer
Admin customer object
|
protected com.konakartadmin.app.AdminOrder |
adminOrder
Admin order object
|
protected Customer |
appCustomer
Application customer object
|
protected Order |
appOrder
Application order object
|
protected java.lang.String[] |
bccEmailsStrArray
Blind copy addresses
|
protected java.lang.String |
contentType
Content type
|
protected org.apache.velocity.VelocityContext |
context
Velocity Context
|
protected java.lang.String |
countryCode
country code - it's really locale - eg: "en", "es", "de" etc
|
protected java.lang.String |
customerName
Name of customer
|
protected boolean |
debugEmail
Debug when set to true
|
protected boolean |
deleteAttachmentAfterSend
The attachment should be deleted after send when true
|
protected boolean |
displayPricesWithTax
Prices displayed with tax if true
|
protected boolean |
doBlindCopy
Blind copy activated when true
|
protected java.lang.String |
emailAddr
Destination email address
|
protected java.lang.String |
emailBody
Body of email
|
protected java.lang.String |
emailSubject
Subject of email
|
protected int |
expiryMins
Length of time in minutes before password expires
|
protected java.lang.String |
friendlyAttachmentName
Friendly attachment file name
|
protected java.lang.String |
fromAddressStr
From address in string format
|
protected java.lang.String |
fromName
From name
|
protected java.lang.String |
fullAttachmentFilename
Full attachment file name
|
protected java.lang.String |
imageBaseUrl
Image base URL
|
protected boolean |
isAsync
When true, email is sent asynchronously
|
protected java.lang.String |
konakartAPI
API called to send the mail
|
protected java.lang.String |
message
Email message
|
protected java.lang.String |
newPassword
New password
|
protected int |
productId
Set for sendStockReorderEmail
|
protected java.lang.String |
productName
Set for sendStockReorderEmail
|
protected int |
productQuantity
Set for sendStockReorderEmail
|
protected java.lang.String |
replyToAddressStr
Reply to address in string format
|
protected java.lang.String |
replyToName
Reply to name
|
protected static java.lang.String |
resetCustomerPassword
KonaKartAdmin API name
|
protected static java.lang.String |
sendEmail
KonaKartAdmin API name
|
protected static java.lang.String |
sendNewPassword1
KonaKart API name
|
protected static java.lang.String |
sendOrderConfirmationEmail1
KonaKart API name
|
protected static java.lang.String |
sendStatusChangeEmailForState
KonaKartAdmin API name
|
protected static java.lang.String |
sendStockReorderEmail
KonaKart API name
|
protected static java.lang.String |
sendTemplateEmail
KonaKartAdmin API name
|
protected static java.lang.String |
sendTemplateEmailToCustomer1
KonaKart API name
|
protected static java.lang.String |
sendWelcomeEmail1
KonaKart API name
|
protected java.lang.String |
sku
Set for sendStockReorderEmail
|
protected java.lang.String |
storeId
Id of store
|
protected java.lang.String |
storeName
Name of store
|
protected java.lang.String |
storeOwner
Store Owner
|
protected java.lang.String |
storeOwnerEmailAddr
Email address of store owner
|
protected java.lang.String |
templateBase
Velocity template base directory
|
protected java.lang.String |
templateName
template name
|
protected Order[] |
vendorOrders
Application vendor order objects when in multi-vendor mode
|
basePackage, debugStackTraceExclusions
Constructor and Description |
---|
BaseMailModule() |
Modifier and Type | Method and Description |
---|---|
protected void |
deleteAttachmentFile()
Deletes the attachment file
|
protected com.konakartadmin.blif.AdminConfigurationMgrIf |
getAdminConfigMgr() |
com.konakartadmin.appif.KKAdminIf |
getAdminEng() |
protected java.lang.String |
getConfigurationValue(java.lang.String key)
Works regardless of whether module is being called by Admin or App eng.
|
protected boolean |
getConfigurationValueAsBool(java.lang.String key,
boolean def)
Works regardless of whether module is being called by Admin or App eng.
|
protected int |
getConfigurationValueAsIntWithDefault(java.lang.String key,
int def)
Works regardless of whether module is being called by Admin or App eng.
|
protected java.lang.String |
getContentType()
Get some common content types
|
protected java.lang.String |
getEncodedFileContent()
Get the encoded file content required to send the mail
|
java.lang.String |
getFormattedCustomerName(com.konakartadmin.app.AdminCustomer cust)
Returns the customer name formatted by the template in the configuration variable
|
protected java.lang.String |
getMailDebugInfo()
Create a formatted string of debug information
|
protected java.lang.String |
getStoreId()
Return the storeId
|
protected void |
init(com.konakartadmin.appif.KKAdminIf adminEng)
Init method called from the super class when called from the Admin engine
|
protected boolean |
isAvailable(java.lang.String configKey)
Called to determine whether the module is available.Works regardless of whether module is
being called by Admin or App eng.
|
ExternalMailResult |
sendExternalMail(ExternalMailInput input)
Called by the actual mail module to perform common tasks such as validating the input and
setting local configuration variables
|
void |
setAdminEng(com.konakartadmin.appif.KKAdminIf adminEng) |
protected void |
setConfigs()
Set local configuration values from configuration variables
|
protected void |
setConfigsFromInput(ExternalMailInput input)
Set local configuration values used to send the mail, from the input data
|
void |
setFromAddressStr(java.lang.String fromAddressStr)
If it's in the format "name <abc@defg.com>" we set the name as well
|
void |
setReplyToAddressStr(java.lang.String replyToAddressStr) |
void |
validateExternalMailInput(ExternalMailInput input)
Common validation code for the input object
|
getBasketMgr, getCatMgr, getConfigMgr, getConfiguration, getConfigurationValueAsBigDecimalWithDefault, getCurrMgr, getCustMgr, getCustTagMgr, getDebugStackTraceExclusions, getEmailMgr, getEng, getLangMgr, getModuleClassName, getMultiStoreMgr, getNewCriteria, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getPromMgr, getRandomText, getRandomText, getResourceBundle, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreMgr, getTaxMgr, getZoneCodeForZoneName, init, isAvailable, isMultiStoreShareCustomersOrProducts, setDebugStackTraceExclusions, updateStaticVariablesNow
protected static final java.lang.String sendNewPassword1
protected static final java.lang.String sendWelcomeEmail1
protected static final java.lang.String sendOrderConfirmationEmail1
protected static final java.lang.String sendTemplateEmailToCustomer1
protected static final java.lang.String sendStockReorderEmail
protected static final java.lang.String resetCustomerPassword
protected static final java.lang.String sendStatusChangeEmailForState
protected static final java.lang.String sendTemplateEmail
protected static final java.lang.String sendEmail
protected java.lang.String konakartAPI
protected java.lang.String fromAddressStr
protected java.lang.String fromName
protected java.lang.String replyToAddressStr
protected java.lang.String replyToName
protected java.lang.String[] bccEmailsStrArray
protected boolean debugEmail
protected boolean doBlindCopy
protected org.apache.velocity.VelocityContext context
protected java.lang.String storeOwner
protected java.lang.String storeOwnerEmailAddr
protected java.lang.String storeName
protected java.lang.String storeId
protected java.lang.String imageBaseUrl
protected java.lang.String templateBase
protected boolean displayPricesWithTax
protected java.lang.String customerName
protected Customer appCustomer
protected com.konakartadmin.app.AdminCustomer adminCustomer
protected java.lang.String emailSubject
protected java.lang.String emailBody
protected java.lang.String emailAddr
protected java.lang.String countryCode
protected java.lang.String templateName
protected java.lang.String message
protected Order appOrder
protected Order[] vendorOrders
protected com.konakartadmin.app.AdminOrder adminOrder
protected java.lang.String newPassword
protected int expiryMins
protected java.lang.String contentType
protected boolean isAsync
protected java.lang.String fullAttachmentFilename
protected java.lang.String friendlyAttachmentName
protected boolean deleteAttachmentAfterSend
protected java.lang.String productName
protected int productQuantity
protected int productId
protected java.lang.String sku
public com.konakartadmin.appif.KKAdminIf getAdminEng()
protected void init(com.konakartadmin.appif.KKAdminIf adminEng)
adminEng
- the adminEngpublic void setAdminEng(com.konakartadmin.appif.KKAdminIf adminEng)
adminEng
- the adminEng to setprotected java.lang.String getStoreId() throws com.konakart.app.KKException
getStoreId
in class BaseModule
com.konakart.app.KKException
- an unexpected exception from the KonaKart enginepublic ExternalMailResult sendExternalMail(ExternalMailInput input) throws java.lang.Exception
input
- the inputjava.lang.Exception
- an unexpected exceptionprotected void setConfigs() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionprotected void setConfigsFromInput(ExternalMailInput input) throws java.lang.Exception
input
- the inputjava.lang.Exception
- an unexpected exceptionprotected java.lang.String getMailDebugInfo()
protected boolean isAvailable(java.lang.String configKey) throws com.konakart.app.KKException
isAvailable
in class BaseModule
configKey
- the configKeycom.konakart.app.KKException
- an unexpected KKException exceptionprotected com.konakartadmin.blif.AdminConfigurationMgrIf getAdminConfigMgr() throws java.lang.Exception
java.lang.Exception
- an unexpected exceptionpublic void validateExternalMailInput(ExternalMailInput input) throws com.konakart.app.KKException
input
- the inputcom.konakart.app.KKException
- an unexpected KKException exceptionpublic java.lang.String getFormattedCustomerName(com.konakartadmin.app.AdminCustomer cust) throws java.lang.Exception
cust
- the custjava.lang.Exception
- an unexpected exceptionprotected java.lang.String getConfigurationValue(java.lang.String key) throws com.konakart.app.KKException
getConfigurationValue
in class BaseModule
key
- the keycom.konakart.app.KKException
- an unexpected KKException exceptionprotected boolean getConfigurationValueAsBool(java.lang.String key, boolean def) throws com.konakart.app.KKException
getConfigurationValueAsBool
in class BaseModule
key
- the keydef
- the defaultcom.konakart.app.KKException
- an unexpected KKException exceptionprotected int getConfigurationValueAsIntWithDefault(java.lang.String key, int def) throws com.konakart.app.KKException
getConfigurationValueAsIntWithDefault
in class BaseModule
key
- the keydef
- the defcom.konakart.app.KKException
- an unexpected KKException exceptionpublic void setFromAddressStr(java.lang.String fromAddressStr)
fromAddressStr
- the fromAddressStr to setpublic void setReplyToAddressStr(java.lang.String replyToAddressStr)
replyToAddressStr
- the replyToAddressStr to setprotected void deleteAttachmentFile()
protected java.lang.String getEncodedFileContent() throws java.io.IOException
java.io.IOException
- an unexpected IOException exceptionprotected java.lang.String getContentType()
Copyright © 2018 DS Data Systems UK Ltd.