Commit 77ef0383 authored by Ajit Deshmukh's avatar Ajit Deshmukh

Added changes in buildMailXMLStr method if body doesn't have HTML return error code.

parent 5e6a6288
......@@ -48,8 +48,10 @@ public class MarketingCampaignPreSend extends ActionHandlerEJB {
try {
body = readHtmlFile(bodyFilePath);
} catch (IOException e1) {
BaseLogger.log("3", null, null, "Exception in readHtmlFile method [" + emailID + "]");
mailXMLStr = "NULLHTML";
BaseLogger.log("3", null, null, "Exception in readHtmlFile method [" + e1.getMessage() + "]");
e1.printStackTrace();
return mailXMLStr;
}
String formatCode = "";
......@@ -80,6 +82,7 @@ public class MarketingCampaignPreSend extends ActionHandlerEJB {
mailXMLStr += "<BCC_ADD><![CDATA[" + mailFormatDetails.get("BLIND_COPY") + "]]></BCC_ADD>";
mailXMLStr += "<BODY_TEXT><![CDATA[" + body + "]]></BODY_TEXT>";
mailXMLStr += "<SUBJECT><![CDATA[" + mailFormatDetails.get("SUBJECT") + "]]></SUBJECT>";
mailXMLStr += "</ROOT>";
System.out.println("mailXMLStr....::" + mailXMLStr);
......@@ -137,8 +140,8 @@ public class MarketingCampaignPreSend extends ActionHandlerEJB {
}
closeResources(rs, pstmt);
BaseLogger.log("3", null, null, "mail list [" + mailList + "]");
//To check weather email Id present or not in mailing_list
if(mailList.isEmpty()) {
// To check weather email Id present or not in mailing_list
if (mailList.isEmpty()) {
retString = itmDBAccessEJB.getErrorString("", "NMAILIST", "", "", conn);
return retString;
}
......@@ -283,6 +286,11 @@ public class MarketingCampaignPreSend extends ActionHandlerEJB {
BaseLogger.log("3", null, null, "Mail from [" + fromEmailId + "]");
String mailXMLStr = buildMailXMLStr(mailFormatDetails, userInfo);
if(mailXMLStr.equals("NULLHTML")) {
BaseLogger.log("3", null, null, "mailXMLStr string[" + mailXMLStr + "]");
retString = itmDBAccessEJB.getErrorString("", mailXMLStr, "", "", conn);
return retString;
}
String emailStatus;
try {
emailStatus = email.sendMail(mailXMLStr, "ITM", userInfo);
......@@ -346,14 +354,14 @@ public class MarketingCampaignPreSend extends ActionHandlerEJB {
String formatCode = "";
String subject = "";
String bodyText = "", msg = "";
// boolean updateFlag = false;
//boolean updateFlag = false;
String retString = "";
UserInfoBean userInfo = getUserInfo();
System.out.println("********************userinfo****************" + userInfo);
try {
conn = getConnection();
userId = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
userId = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
BaseLogger.log("3", null, null, "user id [" + userId + "]");
BaseLogger.log("3", null, null, "tran id [" + tranId + "]");
......@@ -366,7 +374,7 @@ public class MarketingCampaignPreSend extends ActionHandlerEJB {
}
closeResources(rs, pstmt);
// Check weather email id present or not against loged in user
if (userEmail == null) {
if (userEmail == null ) {
BaseLogger.log("3", null, null, "In null condition [" + userEmail + "]");
retString = itmDBAccessEJB.getErrorString("", "NULEMAILID", "", "", conn);
return retString;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment