def METHOD_NAME(instance, sender, created, **kwargs):
    """Send a notification when rating a layer, map or document"""
    notice_type_label = f"{instance.content_object.class_name.lower()}_rated"
    recipients = get_notification_recipients(notice_type_label, instance.user, resource=instance.content_object)
    send_notification(
        recipients,
        notice_type_label,
        {"resource": instance.content_object, "user": instance.user, "rating": instance.rating},
    )