protected String buildRequestBody(final EmailMessageRequest emailRequest,
                                      final String recipient) throws Exception {
        val from = new Email(emailRequest.getEmailProperties().getFrom());
        val subject = determineEmailSubject(emailRequest, messageSource);

        val to = new Email(recipient);
        val type = emailRequest.getEmailProperties().isHtml()
            ? MediaType.TEXT_PLAIN_VALUE
            : MediaType.TEXT_HTML_VALUE;
        val content = new Content(type, emailRequest.getBody());
        val mail = new Mail(from, subject, to, content);
        return mail.build();
    }
This is {@link SendGridEmailSender}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-sendgrid/src/main/java/org/apereo/cas/mail/SendGridEmailSender.java