def METHOD_NAME(sender, instance, **kwargs):
    """Create, update or delete a registration reminder for the event if necessary."""
    message = getattr(instance, "registration_reminder", None)
    if not instance.published or not instance.registration_required:
        # Remove existing not-sent notification if the event
        # isn't published or registration isn't required.
        if message is not None and not message.sent:
            instance.registration_reminder = None
            message.delete()
    else:
        reminder_time = instance.registration_start - timezone.timedelta(hours=1)
        # Delete reminder if the event is changed so that the reminder time has now passed.
        if (
            message is not None
            and message.time != reminder_time
            and reminder_time < timezone.now()
        ):
            instance.registration_reminder = None
            message.delete()
            return
        # Don't update if the message has already been sent or the reminder time has passed.
        if (message is not None and message.sent) or reminder_time < timezone.now():
            return
        if message is None:
            message = RegistrationReminderMessage(event=instance)
        message.title = "Event registration"
        message.body = f"Registration for '{instance.title}' starts in 1 hour"
        message.url = f"{settings.BASE_URL}{instance.get_absolute_url()}"
        message.category = Category.objects.get(key=Category.EVENT)
        message.time = reminder_time
        message.save()
        message.users.set(Member.current_members.all())