def METHOD_NAME(
    user_id: int,
    organization: Organization,
    provider: ExternalProviders,
) -> Mapping[str, RpcIntegration]:
    identities = identity_service.get_user_identities_by_provider_type(
        user_id=user_id,
        provider_type=EXTERNAL_PROVIDERS[provider],
        exclude_matching_external_ids=True,
    )
    if not identities:
        # The user may not have linked their identity so just move on
        # since there are likely other users or teams in the list of
        # recipients.
        return {}
    identity_id_to_idp = {
        identity.id: identity_service.get_provider(provider_id=identity.idp_id)
        for identity in identities
    }
    all_integrations = integration_service.get_integrations(
        organization_id=organization.id,
        status=ObjectStatus.ACTIVE,
        org_integration_status=ObjectStatus.ACTIVE,
        limit=None,
        providers=[EXTERNAL_PROVIDERS[provider]],
    )
    all_external_ids = [identity_id_to_idp[identity.id].external_id for identity in identities]
    integrations = [i for i in all_integrations if i.external_id in all_external_ids]
    channels_to_integration = {}
    for identity in identities:
        for integration in integrations:
            idp = identity_id_to_idp[identity.id]
            if idp and idp.external_id == integration.external_id:
                channels_to_integration[identity.external_id] = integration
                break
    return channels_to_integration