protected EmailMessageRequest prepareEmailMessageRequest(final RequestContext requestContext,
                                                             final EmailMessageBodyBuilder bodyBuilder,
                                                             final Principal principal,
                                                             final String attribute) {
        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
        val locale = Optional.ofNullable(RequestContextUtils.getLocaleResolver(request))
            .map(resolver -> resolver.resolveLocale(request));
        return EmailMessageRequest.builder()
            .emailProperties(properties.getMail())
            .locale(locale.orElseGet(Locale::getDefault))
            .principal(principal)
            .attribute(SpringExpressionLanguageValueResolver.getInstance().resolve(attribute))
            .body(bodyBuilder.get())
            .tenant(tenantExtractor.extract(requestContext).map(TenantDefinition::getId).orElse(StringUtils.EMPTY))
            .context(bodyBuilder.getParameters())
            .build();
    }
This is {@link CasSimpleMultifactorSendEmail}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-simple-mfa-core/src/main/java/org/apereo/cas/mfa/simple/web/flow/CasSimpleMultifactorSendEmail.java