protected EmailCommunicationResult sendForgotUsernameEmailToAccount(final PasswordManagementQuery query,
                                                                        final RequestContext requestContext) throws Throwable {
        val parameters = CollectionUtils.wrap("username", query.getUsername(), "email", query.getEmail());
        val credential = new BasicIdentifiableCredential();
        credential.setId(query.getUsername());
        val person = principalResolver.resolve(credential);
        FunctionUtils.doIf(person != null && !(person instanceof NullPrincipal),
            principal -> {
                parameters.put("principal", principal);
                requestContext.getFlashScope().put(Principal.class.getName(), person);
            }).accept(person);
        val reset = casProperties.getAuthn().getPm().getForgotUsername().getMail();
        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
        val locale = Optional.ofNullable(RequestContextUtils.getLocaleResolver(request))
            .map(resolver -> resolver.resolveLocale(request));
        val body = EmailMessageBodyBuilder.builder()
            .properties(reset)
            .locale(locale)
            .parameters(parameters)
            .build()
            .get();
        val emailRequest = EmailMessageRequest.builder()
            .emailProperties(reset)
            .locale(locale.orElseGet(Locale::getDefault))
            .to(List.of(query.getEmail()))
            .tenant(tenantExtractor.extract(requestContext).map(TenantDefinition::getId).orElse(StringUtils.EMPTY))
            .body(body)
            .build();
        return communicationsManager.email(emailRequest);
    }
Parameter name to look up the user.
support/cas-server-support-pm-webflow/src/main/java/org/apereo/cas/pm/web/flow/actions/SendForgotUsernameInstructionsAction.java