Source:
<code>protected void notify(JobExecutionContext jobExecutionContext, String jobStatus) { try { StringBuilder mailMessageSubject = new StringBuilder(jobExecutionContext.getJobDetail().getGroup()).append(": ").append(jobExecutionContext.getJobDetail().getName()); BodyMailMessage mailMessage = new BodyMailMessage(); mailMessage.setFromAddress(emailService.getDefaultFromAddress()); if (jobExecutionContext.getMergedJobDataMap().containsKey(REQUESTOR_EMAIL_ADDRESS_KEY) && !StringUtils.isBlank(jobExecutionContext.getMergedJobDataMap().getString(REQUESTOR_EMAIL_ADDRESS_KEY))) { mailMessage.addToAddress(jobExecutionContext.getMergedJobDataMap().getString(REQUESTOR_EMAIL_ADDRESS_KEY)); } if (SchedulerService.FAILED_JOB_STATUS_CODE.equals(jobStatus) || SchedulerService.CANCELLED_JOB_STATUS_CODE.equals(jobStatus)) { <START> mailMessage.addToAddress(emailService.getDefaultFromAddress()); <END> } String url = SpringContext.getBean(ParameterService.class).getParameterValueAsString("KFS-SYS", "Batch", "BATCH_REPORTS_URL"); mailMessageSubject.append(": ").append(jobStatus); String messageText = MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.MESSAGE_BATCH_FILE_LOG_EMAIL_BODY), url); mailMessage.setMessage(messageText); if (mailMessage.getToAddresses().size() > 0) { mailMessage.setSubject(mailMessageSubject.toString()); emailService.sendMessage(mailMessage, false); } } catch (Exception iae) { LOG.error("Caught exception while trying to send job completion notification e-mail for " + jobExecutionContext.getJobDetail().getName(), iae); } }</code><technical_language>Another area default "to" instead of default "from"</technical_language>

Target:
protected void notify(JobExecutionContext jobExecutionContext, String jobStatus) { try { StringBuilder mailMessageSubject = new StringBuilder(jobExecutionContext.getJobDetail().getGroup()).append(": ").append(jobExecutionContext.getJobDetail().getName()); BodyMailMessage mailMessage = new BodyMailMessage(); mailMessage.setFromAddress(emailService.getDefaultFromAddress()); if (jobExecutionContext.getMergedJobDataMap().containsKey(REQUESTOR_EMAIL_ADDRESS_KEY) && !StringUtils.isBlank(jobExecutionContext.getMergedJobDataMap().getString(REQUESTOR_EMAIL_ADDRESS_KEY))) { mailMessage.addToAddress(jobExecutionContext.getMergedJobDataMap().getString(REQUESTOR_EMAIL_ADDRESS_KEY)); } if (SchedulerService.FAILED_JOB_STATUS_CODE.equals(jobStatus) || SchedulerService.CANCELLED_JOB_STATUS_CODE.equals(jobStatus)) { mailMessage.addToAddress(emailService.getDefaultToAddress()); } String url = SpringContext.getBean(ParameterService.class).getParameterValueAsString("KFS-SYS", "Batch", "BATCH_REPORTS_URL"); mailMessageSubject.append(": ").append(jobStatus); String messageText = MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.MESSAGE_BATCH_FILE_LOG_EMAIL_BODY), url); mailMessage.setMessage(messageText); if (mailMessage.getToAddresses().size() > 0) { mailMessage.setSubject(mailMessageSubject.toString()); emailService.sendMessage(mailMessage, false); } } catch (Exception iae) { LOG.error("Caught exception while trying to send job completion notification e-mail for " + jobExecutionContext.getJobDetail().getName(), iae); } }