def METHOD_NAME(token, userid, message):
    if token:
        if userid:
            try:
                client = SlackClient(token=token)
                blocks = [
                    {
                        "type": "section",
                        "text": {"type": "mrkdwn", "text": message},
                    }
                ]
                client.chat_postMessage(
                    channel="@%s" % userid,
                    blocks=blocks,
                    as_user=True,
                )
            except Exception:
                logger.info("Exception when sending a Slack notification:")
                logger.info(traceback.format_exc())
        else:
            logger.info("The userid of Slack user is not defined.")
    else:
        logger.info(
            "The token of Slack for sending notifications is not defined."
        )