use of org.kuali.kfs.sys.mail.BodyMailMessage in project cu-kfs by CU-CommunityApps.
the class CorporateBilledCorporatePaidRouteStepReportServiceImpl method sendReportEmail.
@Override
public void sendReportEmail(String toAddress, String fromAddress) {
BodyMailMessage message = new BodyMailMessage();
message.setFromAddress(fromAddress);
String subject = reportWriterService.getTitle();
message.setSubject(subject);
message.getToAddresses().add(toAddress);
String body = concurBatchUtilityService.getFileContents(reportWriterService.getReportFile().getAbsolutePath());
message.setMessage(body);
boolean htmlMessage = false;
if (LOG.isDebugEnabled()) {
LOG.debug("sendEmail, from address: " + fromAddress + " to address: " + toAddress);
LOG.debug("sendEmail, the email subject: " + subject);
LOG.debug("sendEmail, the email budy: " + body);
}
try {
emailService.sendMessage(message, htmlMessage);
} catch (Exception e) {
LOG.error("sendEmail, the email could not be sent", e);
}
}
use of org.kuali.kfs.sys.mail.BodyMailMessage in project cu-kfs by CU-CommunityApps.
the class CreateAccountingDocumentReportServiceImpl method sendReportEmail.
@Override
public void sendReportEmail(String toAddress, String fromAddress) {
BodyMailMessage message = new BodyMailMessage();
message.setFromAddress(fromAddress);
String subject = reportWriterService.getTitle();
message.setSubject(subject);
message.getToAddresses().add(toAddress);
String body = concurBatchUtilityService.getFileContents(reportWriterService.getReportFile().getAbsolutePath());
message.setMessage(body);
boolean htmlMessage = false;
if (LOG.isDebugEnabled()) {
LOG.debug("sendEmail, from address: " + fromAddress + " to address: " + toAddress);
LOG.debug("sendEmail, the email subject: " + subject);
LOG.debug("sendEmail, the email budy: " + body);
}
try {
emailService.sendMessage(message, htmlMessage);
} catch (Exception e) {
LOG.error("sendEmail, the email could not be sent", e);
}
}
use of org.kuali.kfs.sys.mail.BodyMailMessage in project cu-kfs by CU-CommunityApps.
the class AdvanceDepositServiceImpl method sendEmail.
private void sendEmail(FlatFileInformation fileInformation) {
if (LOG.isDebugEnabled()) {
LOG.debug("sendEmail() starting");
}
BodyMailMessage message = new BodyMailMessage();
String returnAddress = parameterService.getParameterValueAsString(LoadAchIncomeFileStep.class, CuFPParameterConstants.AchIncome.ACH_INCOME_SUMMARY_FROM_EMAIL_ADDRESS);
if (StringUtils.isEmpty(returnAddress)) {
returnAddress = emailService.getDefaultFromAddress();
}
message.setFromAddress(returnAddress);
String subject = parameterService.getParameterValueAsString(LoadAchIncomeFileStep.class, CuFPParameterConstants.AchIncome.ACH_INCOME_SUMMARY_EMAIL_SUBJECT);
message.setSubject(subject);
List<String> toAddressList = new ArrayList<>(parameterService.getParameterValuesAsString(LoadAchIncomeFileStep.class, CuFPParameterConstants.AchIncome.ACH_INCOME_SUMMARY_TO_EMAIL_ADDRESSES));
message.getToAddresses().addAll(toAddressList);
String body = composeAchIncomeSummaryEmailBody(fileInformation);
message.setMessage(body);
emailService.sendMessage(message, false);
}
use of org.kuali.kfs.sys.mail.BodyMailMessage in project cu-kfs by CU-CommunityApps.
the class ProcurementCardErrorEmailServiceImpl method sendErrorEmail.
public void sendErrorEmail(ArrayList<String> errorMessages) {
BodyMailMessage message = new BodyMailMessage();
message.setFromAddress(emailService.getDefaultFromAddress());
message.setSubject(buildErrorEmailSubject());
message.setToAddresses(getToAddresses());
message.setMessage(generateBody(errorMessages));
emailService.sendMessage(message, false);
}
use of org.kuali.kfs.sys.mail.BodyMailMessage in project cu-kfs by CU-CommunityApps.
the class CuPdpEmailServiceImpl method createAdviceMessageAndPopulateHeader.
/**
* KFSPTS-1460: New method. created from code in sendAchAdviceEmail.
* @return
*/
private BodyMailMessage createAdviceMessageAndPopulateHeader(PaymentGroup paymentGroup, CustomerProfile customer, String productionEnvironmentCode, String environmentCode) {
LOG.debug("createAdviceMessageAndPopulateHeader() starting");
BodyMailMessage message = new BodyMailMessage();
String fromAddress = customer.getAdviceReturnEmailAddr();
if ((fromAddress == null) || (fromAddress.isEmpty())) {
// get the default from address
fromAddress = parameterService.getParameterValueAsString(CUKFSParameterKeyConstants.KFS_PDP, CUKFSParameterKeyConstants.ALL_COMPONENTS, CUKFSParameterKeyConstants.PDP_CUSTOMER_MISSING_ADVICE_RETURN_EMAIL);
}
if (StringUtils.equals(productionEnvironmentCode, environmentCode)) {
message.addToAddress(paymentGroup.getAdviceEmailAddress());
message.addCcAddress(paymentGroup.getAdviceEmailAddress());
message.addBccAddress(paymentGroup.getAdviceEmailAddress());
message.setFromAddress(fromAddress);
message.setSubject(customer.getAdviceSubjectLine());
} else {
message.addToAddress(emailService.getDefaultToAddress());
message.addCcAddress(emailService.getDefaultToAddress());
message.addBccAddress(emailService.getDefaultToAddress());
message.setFromAddress(fromAddress);
message.setSubject(environmentCode + ": " + customer.getAdviceSubjectLine() + ":" + paymentGroup.getAdviceEmailAddress());
}
LOG.debug("sending email to " + paymentGroup.getAdviceEmailAddress() + " for disb # " + paymentGroup.getDisbursementNbr());
return message;
}
Aggregations