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 committed Dec 19, 2024
1 parent f7dfb71 commit f0c8261
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 f0c8261

Please sign in to comment.