private boolean tryToSendEmail(final RequestContext requestContext,
                                   final EnumSet<TokenSharingStrategyOptions> communicationStrategy,
                                   final Principal principal,
                                   final Map<TokenSharingStrategyOptions, List<String>> mapOfAllRecipients,
                                   final CasSimpleMultifactorAuthenticationTicket token) {
        if (communicationStrategy.contains(TokenSharingStrategyOptions.EMAIL) && communicationsManager.isMailSenderDefined()) {
            val cmd = CasSimpleMultifactorSendEmail.of(communicationsManager, properties, tenantExtractor);
            val recipients = cmd.getEmailMessageRecipients(principal, requestContext);

            val currentEvent = requestContext.getCurrentEvent();
            var registeredEmailAddress = StringUtils.EMPTY;
            if (recipients.isEmpty() && currentEvent != null
                && currentEvent.getId().equals(CasWebflowConstants.TRANSITION_ID_RESUME)) {
                registeredEmailAddress = currentEvent.getAttributes().getRequiredString(CasSimpleMultifactorVerifyEmailAction.TOKEN_PROPERTY_EMAIL_TO_REGISTER);
                recipients.add(registeredEmailAddress);
            }

            if (!recipients.isEmpty()) {
                mapOfAllRecipients.put(TokenSharingStrategyOptions.EMAIL, recipients);
            }

            if (recipients.size() > 1) {
                val selectedEmailRecipients = findSelectedEmailRecipients(requestContext, principal);
                LOGGER.debug("Selected email recipients are [{}]", selectedEmailRecipients);
                if (!selectedEmailRecipients.isEmpty()) {
                    var emailSent = cmd.send(principal, token, selectedEmailRecipients, requestContext).isAnyEmailSent();
                    if (!emailSent) {
                        WebUtils.addErrorMessageToContext(requestContext, MESSAGE_MFA_CONTACT_FAILED_EMAIL);
                    }
                    return emailSent;
                }
            } else if (StringUtils.isNotBlank(registeredEmailAddress)) {
                var emailSent = cmd.send(principal, token, List.of(registeredEmailAddress), requestContext).isAnyEmailSent();
                if (!emailSent) {
                    WebUtils.addErrorMessageToContext(requestContext, MESSAGE_MFA_CONTACT_FAILED_EMAIL);
                }
                return emailSent;
            } else {
                var emailSent = cmd.send(principal, token, requestContext).isAnyEmailSent();
                if (!emailSent) {
                    WebUtils.addErrorMessageToContext(requestContext, MESSAGE_MFA_CONTACT_FAILED_EMAIL);
                }
                return emailSent;
            }
        }
        return false;
    }
Event attribute to allow registration of email.
support/cas-server-support-simple-mfa-core/src/main/java/org/apereo/cas/mfa/simple/web/flow/CasSimpleMultifactorSendTokenAction.java