public class AdminSendProductSuggestionBatchMgr extends AdminBatchBaseMgr
AdminBatchBaseMgr.CustTagCounter
AdminBaseMgr.StaticData
log
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, debugStackTraceExclusions, kkAdminPropsFilePath, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
Constructor and Description |
---|
AdminSendProductSuggestionBatchMgr(KKAdminIf eng) |
Modifier and Type | Method and Description |
---|---|
private com.konakart.db.KKCriteria |
getCustomerSuggestionCriteria(int version)
Create a criteria object for reading suggestion records
|
private boolean |
sendCustomerSuggestionEmail(java.io.BufferedWriter bw,
AdminCustomerMgrIf custMgr,
AdminProductMgrIf prodMgr,
int customerId,
int productId,
java.lang.String templateName,
java.lang.String viewProductCommand,
boolean sendEmails,
java.util.concurrent.ExecutorService executor)
private method to create and insert a coupon code and send an email to the customer with the
code.
|
java.lang.String |
sendCustomerSuggestions(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr,
java.lang.String emailTemplateName,
java.lang.String viewProductCommand,
java.lang.String numEmailThreadsStr,
java.lang.String sendEmailStr,
java.lang.String testCustIdStr)
The purpose of this batch job is to use the Customer Product Suggestions to send out
marketing emails in order to promote the sale of products with the highest likelihood of
potential for sale.
|
ensureCustomerTagIsPresent, getAdEngConf, getAdminJsonEngine, getBatchLogName, getBoolean, getCustomerTagsHash, getInt, getIntArray, getIntArray, getLiteCustomerCriteria, getLiteCustomers, getLogName, getOrders, getSkuForProduct, insertOrUpdateCustomerTag, trimMultiTag, validateTemplate
addInsertAttr, addInsertAttr, addStringRuleConstraint, addStringRuleConstraint, checkAPICallEnabled, checkIntInRange, checkIntIsSet, checkRequired, executeQuery, executeQuery, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminContentMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustPwdHistMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminEngineCacheMgr, getAdminEventMgr, getAdminExecuteMgr, getAdminFileMgr, getAdminFilterMgr, getAdminHtmlMgr, getAdminImportMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminMiscPriceMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminServletMgr, getAdminShipmentMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminSuggestionMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getDebugStackTraceExclusions, getEmailThreadGracefulShutdownTimeout, getExportMgr, getExportMgr, getExportXMLData, getIntFromString, getKkAdminPropsFilePath, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getNewCriteria, getNewCriteria, getOtherModuleByName, getPostSearchText, getPreSearchText, getProductsToCategoresCriteria, getPropertyValue, getPropertyValue, getPropertyValueAsBool, getPropertyValueAsInt, getPropertyValueAsLong, getRecordCount, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, insertKKEvent, insertKKEvent, isBusiness, isBusinessOrEnterprise, isCommunity, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareCustomersOrProducts, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, isUnix, isWindows, manageException, manageThrowable, refreshConfigs, removeCData, sendMQMessages, setAdminEng, setDebugStackTraceExclusions, setKkAdminPropsFilePath, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr, updateStaticVariablesNow
public AdminSendProductSuggestionBatchMgr(KKAdminIf eng) throws java.lang.Exception
eng
- the KKAdminIf enginejava.lang.Exception
- an unexpected exceptionpublic java.lang.String sendCustomerSuggestions(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr, java.lang.String emailTemplateName, java.lang.String viewProductCommand, java.lang.String numEmailThreadsStr, java.lang.String sendEmailStr, java.lang.String testCustIdStr) throws java.lang.Exception
The Suggestions should already be populated in the database. Ideally these will have been populated using the Zucchetti AI service.
The email template must exist in all available locales since the country code from the customer's locale is used. If the customer's locale has not been set, then the country code of the default language is used.
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false. The
old log is overwritten if the name is the same.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.emailTemplateName
- The name of the eMail template if the batch involves sending eMails to customers.
The name should not include the extension or the underscore+country code. i.e. It
should be myTemplate rather than myTemplate_en.vm. The country code and file
extension will be added automatically.viewProductCommand
- used to create the link within the email to view the product.numEmailThreadsStr
- If the batch involves sending eMails to customers, this determines how many eMail
sender threads are used. It defaults to 5.sendEmailStr
- Mails will only sent if this value is set to "true". If set to "false" the batch
job will still execute but it will simply produce a list of emails that it would
have sent if this value was set to "true". It's useful for testing purposes.testCustIdStr
- If this parameter is a CustomerId set it will define the only Customer to actually
receive an email. Useful for testing. Set this parameter to -1 to send emails to
all customers.java.lang.Exception
- an unexpected exceptionprivate com.konakart.db.KKCriteria getCustomerSuggestionCriteria(int version) throws KKAdminException
version
- the versionKKAdminException
- unexpected exception in the KonaKart Admin Engineprivate boolean sendCustomerSuggestionEmail(java.io.BufferedWriter bw, AdminCustomerMgrIf custMgr, AdminProductMgrIf prodMgr, int customerId, int productId, java.lang.String templateName, java.lang.String viewProductCommand, boolean sendEmails, java.util.concurrent.ExecutorService executor) throws java.lang.Exception
bw
- the bwcustMgr
- the custMgrprodMgr
- the prodMgrcustomerId
- the customerIdproductId
- the productIdtemplateName
- the templateNameviewProductCommand
- the viewProductCommandsendEmails
- whether or not to actually send the emailexecutor
- the executorjava.lang.Exception
- an unexpected exceptionCopyright © 2018 DS Data Systems UK Ltd.