def METHOD_NAME(
    user, notification_type: FineTuningAPIKey, data: Mapping[str, Any]
):
    with transaction.atomic(using=router.db_for_write(NotificationSetting)):
        for setting_obj_id_str, value_str in data.items():
            setting_obj_id_int = int(setting_obj_id_str)
            # This partitioning always does the same thing because notification_type stays constant.
            project_option, organization_option = (
                (None, setting_obj_id_int)
                if notification_type == FineTuningAPIKey.DEPLOY
                else (setting_obj_id_int, None)
            )
            type = get_type_from_fine_tuning_key(notification_type)
            value_int = int(value_str)
            NotificationSetting.objects.update_settings(
                ExternalProviders.EMAIL,
                type,
                get_option_value_from_int(type, value_int),
                user_id=user.id,
                project=project_option,
                organization=organization_option,
            )
    return Response(status=status.HTTP_204_NO_CONTENT)