def METHOD_NAME(self, instance, validated_data):
    # only a pending invitation can be updated
    if instance.status != ProjectInvitation.Status.PENDING:
        raise serializers.ValidationError(
            _("Only pending invitations can be updated")
        )
    self._validate_email_exists(validated_data["email"])
    has_email_changed = instance.email != validated_data["email"]
    updated_instance = super().METHOD_NAME(instance, validated_data)
    if has_email_changed:
        self._send_project_invitation_email(instance.id)
    return updated_instance