@Override
    public boolean notify(final Principal principal, final Map<String, String> messageData) {
        val body = buildNotificationMessageBody(messageData);
        val slackUsernames = FunctionUtils.doIfNotBlank(slackProperties.getUsernameAttribute(),
            () -> principal.getAttributes().get(slackProperties.getUsernameAttribute()),
            () -> List.of(principal.getId()));
        return slackUsernames
            .stream()
            .allMatch(Unchecked.predicate(slackUsername -> {
                val channel = StringUtils.prependIfMissing(slackUsername.toString(), "@");
                val messageRequest = ChatPostMessageRequest.builder()
                    .channel(channel)
                    .text(body)
                    .linkNames(true)
                    .mrkdwn(true)
                    .build();
                val response = slackMethods.chatPostMessage(messageRequest);
                LOGGER.trace(response.toString());
                FunctionUtils.doIfNotBlank(response.getError(),
                    __ -> LoggingUtils.error(LOGGER, "Error: %s, Provided: %s, Needed: %s"
                        .formatted(response.getError(), response.getProvided(), response.getNeeded())));
                FunctionUtils.doIfNotBlank(response.getWarning(), LOGGER::warn);
                return response.isOk();
            }));
    }
This is {@link SlackNotificationSender}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-notifications-slack/src/main/java/org/apereo/cas/notifications/SlackNotificationSender.java