Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
fixed send mail issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dreske committed Mar 2, 2023
1 parent e391c56 commit f45981f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ public void processEntry(JobEntry jobEntry) throws IOException, MessagingExcepti
body = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
}

var blob = s3Client.getObject(bucketName, jobEntry.getAttachmentFilename());
if (blob == null) {
throw new IllegalStateException("Attachment to found");
}

Map<String, File> attachments = new HashMap<>();
try {
if (jobEntry.getJob().isSendEmail()) {
var blob = s3Client.getObject(bucketName, jobEntry.getAttachmentFilename());
if (blob == null) {
throw new IllegalStateException("Attachment to found");
}

var attachmentFile = File.createTempFile("attachment", ".pdf");
FileUtils.copyInputStreamToFile(blob.getObjectContent(), attachmentFile);
attachments.put(jobEntry.getAttachmentFilename(), attachmentFile);
Expand Down

0 comments on commit f45981f

Please sign in to comment.