Skip to content

Commit

Permalink
bugfix: send html emails in legacy features (#1110)
Browse files Browse the repository at this point in the history
* bugfix: send html emails in legacy features

* bugfix: set default charset to UTF-8
  • Loading branch information
lmoesle authored Dec 12, 2023
1 parent d68e6dc commit 8f37890
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void execute(final DelegateExecution delegateExecution) throws Exception
.receivers(receivers)
.subject(subject)
.body(emailBody)
.htmlBody(true)

Check warning on line 68 in digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/legacy/mailing/process/SendMailTemplateDelegate.java

View check run for this annotation

Codecov / codecov/patch

digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/legacy/mailing/process/SendMailTemplateDelegate.java#L68

Added line #L68 was not covered by tests
.replyTo(replyTo.orElse(null))
.sender(sender.orElse(null))
.attachments(fileAttachments)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public void execute(final DelegateExecution delegateExecution) throws Exception
.receivers(receivers)
.subject(subject)
.body(emailBody)
.htmlBody(true)
.replyTo(replyTo.orElse(null))

Check warning on line 71 in digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/legacy/mailing/process/SendMailTemplateWithLinkDelegate.java

View check run for this annotation

Codecov / codecov/patch

digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/legacy/mailing/process/SendMailTemplateWithLinkDelegate.java#L70-L71

Added lines #L70 - L71 were not covered by tests
.attachments(fileAttachments)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void sendMail(@Valid Mail mail, String logoPath) throws MessagingExceptio
mimeMessage.setReplyTo(InternetAddress.parse(mail.getReplyTo()));
}

final var helper = new MimeMessageHelper(mimeMessage, true);
final var helper = new MimeMessageHelper(mimeMessage, true, StandardCharsets.UTF_8.name());

helper.setSubject(mail.getSubject());
helper.setText(mail.getBody(), mail.isHtmlBody());
Expand Down

0 comments on commit 8f37890

Please sign in to comment.