@Override
    public EmailCommunicationResult send(final EmailMessageRequest emailRequest) {
        val results = emailRequest.getRecipients()
            .stream()
            .map(recipient -> FunctionUtils.doAndHandle(() -> {
                val response = sendEmailWithSendGrid(emailRequest, recipient);
                LOGGER.debug("SendGrid response [{}]:[{}]", response.getStatusCode(), response.getBody());
                return EmailCommunicationResult.builder()
                    .success(HttpStatus.valueOf(response.getStatusCode()).is2xxSuccessful())
                    .to(List.of(recipient))
                    .body(response.getBody())
                    .details(response.getHeaders())
                    .build();
            },
                e -> EmailCommunicationResult.builder().success(false).body(e.getMessage()).build()).get())
            .toList();

        return results
            .stream()
            .filter(r -> !r.isSuccess())
            .findFirst()
            .orElseGet(() -> EmailCommunicationResult.builder().success(true).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