diff --git a/src/main/java/org/folio/rest/delegate/EmailDelegate.java b/src/main/java/org/folio/rest/delegate/EmailDelegate.java index 4670985f..553416f3 100644 --- a/src/main/java/org/folio/rest/delegate/EmailDelegate.java +++ b/src/main/java/org/folio/rest/delegate/EmailDelegate.java @@ -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"); } } };