Skip to content

Commit

Permalink
chore(mail-connector): cherry pick assertTrue for validation of htmlb…
Browse files Browse the repository at this point in the history
…ody and text body
  • Loading branch information
itsnuyen authored and mathias-vandaele committed Dec 20, 2024
1 parent 396498d commit 6b37a69
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ public record SmtpSendEmail(
@Valid
String htmlBody)
implements SmtpAction {
@AssertTrue(message = "Please provide a proper message body")
@AssertTrue(message = "Please provide a proper message body")
public boolean isEmailMessageValid() {
return switch (contentType) {
case PLAIN -> body != null;
case HTML -> htmlBody != null;
case MULTIPART -> body != null && htmlBody != null;
};
}
}
}

0 comments on commit 6b37a69

Please sign in to comment.