Skip to content

Commit

Permalink
Rename sanction and license options txt email templates to include po…
Browse files Browse the repository at this point in the history
…stfix (#1038)
  • Loading branch information
zhx828 authored Oct 23, 2023
1 parent 09decc3 commit d29e9cb
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public enum MailType {
.templateName("rejectionUsSanctionEmail")
.description("User Rejection - US Sanction")
.titleKey("email.reject.title")
.stringTemplateName("rejectionUsSanctionEmail.txt"))
.stringTemplateName("rejectionUsSanctionEmailString.txt"))
, REJECT_ALUMNI_ADDRESS(new MailTypeBuilder()
.templateName("alumniEmailAddress")
.description("Reject - Registered under alumni email address")
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/mskcc/cbio/oncokb/service/MailService.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void sendEmail(String to, String from, String cc, String subject, String
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
MimeMessageHelper message = new MimeMessageHelper(mimeMessage, isMultipart, StandardCharsets.UTF_8.name());
message.setTo(to);
if (cc != null) {
if (StringUtils.isNotEmpty(cc)) {
message.setCc(cc);
}
message.setFrom(from);
Expand Down Expand Up @@ -190,7 +190,7 @@ public void sendEmailFromSlack(UserDTO user, String subject, String body, MailTy
ccAddress = defaultEmailSendFrom;
}
sendEmail(user.getEmail(), defaultEmailSendFrom, ccAddress, subject, body, null, false, false);
addUserMailsRecord(user, mailType, defaultEmailSendFrom, sendBy != null ? sendBy : "Through slack, unknown sender");
addUserMailsRecord(user, mailType, defaultEmailSendFrom, StringUtils.isNotEmpty(sendBy) ? sendBy : "Through slack, unknown sender");
log.info("Sent email to User '{}'", user.getEmail());
} catch (MailException | MessagingException e) {
log.warn("Email could not be sent to user '{}'", user.getEmail(), e);
Expand Down

0 comments on commit d29e9cb

Please sign in to comment.