Skip to content

Commit

Permalink
Merge pull request #803 from gopalponnusamy/OLE-8923
Browse files Browse the repository at this point in the history
OLE-8923 generateHoldCourtesyNoticeJob sends email notices even though ntc_snd_typ set to "mail"
  • Loading branch information
peris authored Jun 17, 2016
2 parents fbde4c6 + 643f709 commit 1c01815
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ole-app/olefs/src/main/java/org/kuali/ole/OLEConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -2740,6 +2740,7 @@ public static final class OleHoldings {
public static final String ASSIGN_REQUESTOR_INQUIRY = "inquiry.do?methodToCall=start&businessObjectClassName=org.kuali.ole.deliver.bo.OLEPatronEntityViewBo&patronId=";

public static final String DESCRIBE_COMPONENT = "Describe";
public static final String DELIVER_COMPONENT = "Deliver";
public static final String DESCRIBE_EFFECTIVE_DATE = " 00:00:00";

public static final String INSTANCE_EDITOR_DELETE_EINSTANCE = "INSTANCE_EDITOR_DELETE_EINSTANCE";
Expand Down Expand Up @@ -3805,4 +3806,7 @@ public static final class OLEPurchaseOrderBulkAmendment {
public static final String OVER_PAYMENT="refund.over.payment";
public static final String ENTRR_REFUND_AMT="enter.refund.amount";
public static final String FORGIVE_LOST_FEES = "FORGIVE_LOST_FEES";
public static final String ON_HOLD_EXP_NOTICE = "On Hold Expiration Notice";
public static final String HOLD_COUR_NOT_TYP = "HOLDCOURTESY_NOTICE_TYPE";
public static final String EMAIL_NOT_TYP = "email";
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import org.kuali.ole.deliver.notice.bo.OleNoticeContentConfigurationBo;
import org.kuali.ole.deliver.notice.noticeFormatters.RequestEmailContentFormatter;
import org.kuali.ole.deliver.service.NoticesExecutor;
import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator;
import org.kuali.rice.coreservice.api.parameter.Parameter;
import org.kuali.rice.coreservice.api.parameter.ParameterKey;
import org.kuali.rice.kim.impl.identity.type.EntityTypeContactInfoBo;

import java.util.*;
Expand Down Expand Up @@ -151,7 +154,15 @@ public void run() {
if (StringUtils.isNotBlank(mailContent)) {
System.out.println(mailContent);

sendMail(mailContent);
if (noticeContentConfigName.equals(OLEConstants.ON_HOLD_EXP_NOTICE)) {
if (getParameterValue(OLEConstants.HOLD_COUR_NOT_TYP).equals(OLEConstants.EMAIL_NOT_TYP)) {
sendMail(mailContent);
}
} else {
sendMail(mailContent);
}



saveOLEDeliverNoticeHistory(filteredDeliverNotices, mailContent);

Expand Down Expand Up @@ -187,5 +198,12 @@ public Map buildMapForIndexToSolr(String noticeType, String noticeContent, List<
return parameterMap;
}

public String getParameterValue(String key) {
ParameterKey parameterKey = ParameterKey.create(org.kuali.ole.OLEConstants.APPL_ID, org.kuali.ole.OLEConstants.DLVR_NMSPC,"Deliver" , key);
//org.kuali.ole.OLEConstants.DELIVER_COMPONENT
Parameter parameter = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameter(parameterKey);
return parameter != null ? parameter.getValue() : null;
}


}

0 comments on commit 1c01815

Please sign in to comment.