Skip to content

Commit

Permalink
Hot fix (#214)
Browse files Browse the repository at this point in the history
* Added a temporary fix to ensure attachments

* Added additional logging

* Updated workflow components dependency

* Removed include attachment completely
  • Loading branch information
jeremythuff authored May 15, 2023
1 parent a9051f9 commit aab131a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/org/folio/rest/delegate/EmailDelegate.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,21 @@ public void prepare(MimeMessage mimeMessage) throws Exception {
}
}

if (includeAttachment.isPresent() && Boolean.parseBoolean(includeAttachment.get()) && attachmentPath.isPresent()) {
// TODO: This is a hot fix to address an issue with the workflows no attaching emails

// if (includeAttachment.isPresent() && Boolean.parseBoolean(includeAttachment.get()) && attachmentPath.isPresent()) {
if (attachmentPath.isPresent()) {
// logger.info("includeAttachment.isPresent() = {}", includeAttachment.isPresent());
// logger.info("Boolean.parseBoolean(includeAttachment.get()) = {}", Boolean.parseBoolean(includeAttachment.get()));

File attachment = new File(attachmentPath.get());
if (attachment.exists() && attachment.isFile()) {
message.addAttachment(attachment.getName(), attachment);
} else {
logger.info("{} does not exist", attachmentPath.get());
}
} else {
logger.info("No attachment required");
}
}
};
Expand Down

0 comments on commit aab131a

Please sign in to comment.