protected EmailCommunicationResult sendPasswordResetEmailToAccount(
        final Principal principal, final String to, final URL url,
        final HttpServletRequest request) {
        val reset = casProperties.getAuthn().getPm().getReset().getMail();
        val parameters = CollectionUtils.wrap("url", url.toExternalForm(), "principal", principal);
        val locale = Optional.ofNullable(RequestContextUtils.getLocaleResolver(request))
            .map(resolver -> resolver.resolveLocale(request));
        val text = EmailMessageBodyBuilder
            .builder()
            .properties(reset)
            .parameters(parameters)
            .locale(locale)
            .build()
            .get();
        LOGGER.debug("Sending password reset URL [{}] via email to [{}] for username [{}]",
            url, to, principal.getId());
        val emailRequest = EmailMessageRequest
            .builder()
            .emailProperties(reset)
            .principal(principal)
            .to(List.of(to))
            .locale(locale.orElseGet(Locale::getDefault))
            .body(text)
            .build();
        return communicationsManager.getObject().email(emailRequest);
    }
Password reset ops.

@return the response entity
support/cas-server-support-pm-webflow/src/main/java/org/apereo/cas/pm/web/PasswordManagementEndpoint.java