def METHOD_NAME(
    user: User,
    org: RpcOrganization,
    provider: AuthProvider,
    email: str,
    identity_id: str,
) -> AccountConfirmLink:
    """Store and email a verification key for IdP migration.
    Create a one-time verification key for a user whose SSO identity
    has been deleted, presumably because the parent organization has
    switched identity providers. Store the key in Redis and send it
    in an email to the associated address.
    :param user: the user profile to link
    :param org: the organization whose SSO provider is being used
    :param provider: the SSO provider
    :param email: the email address associated with the SSO identity
    :param identity_id: the SSO identity id
    """
    link = AccountConfirmLink(user, org, provider, email, identity_id)
    link.store_in_redis()
    link.send_confirm_email()
    return link