Skip to content
Browse files

added deposit notice address list to error notice

added user email to error notice
  • Loading branch information...
1 parent 1a7113e commit c9a66b02ac08599f56e9fbabe08b958422c455bf @gregjan gregjan committed Mar 15, 2013
Showing with 9 additions and 2 deletions.
  1. +9 −2 forms/src/main/java/cdr/forms/EmailNotificationHandler.java
View
11 forms/src/main/java/cdr/forms/EmailNotificationHandler.java
@@ -126,7 +126,6 @@ public void notifyDeposit(Form form, DepositResult result,
@Override
public void notifyError(Form form, DepositResult result,
String depositorEmail, String formId) {
- if(administratorAddress == null || administratorAddress.trim().length() == 0) return;
// put data into the model
HashMap<String, Object> model = new HashMap<String, Object>();
model.put("form", form);
@@ -153,7 +152,15 @@ public void notifyError(Form form, DepositResult result,
MimeMessage mimeMessage = mailSender.createMimeMessage();
MimeMessageHelper message = new MimeMessageHelper(mimeMessage,
MimeMessageHelper.MULTIPART_MODE_MIXED);
- message.addTo(this.administratorAddress);
+ if(administratorAddress != null && administratorAddress.trim().length() > 0) {
+ message.addTo(this.administratorAddress);
+ }
+ if(!form.getEmailDepositNoticeTo().isEmpty()) {
+ for(String addy : form.getEmailDepositNoticeTo()) {
+ message.addTo(addy);
+ }
+ }
+ if(depositorEmail != null && depositorEmail.trim().length() > 0) message.addTo(depositorEmail);
message.setSubject("Deposit Error for " + form.getTitle());
message.setFrom(this.getFromAddress());
message.setText(textsw.toString() , htmlsw.toString());

0 comments on commit c9a66b0

Please sign in to comment.
Something went wrong with that request. Please try again.