Email required to complete booking?

WordPress Event Management, Calendars & Registration Forums General Question Email required to complete booking?

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 6 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32004

    In spite of making the email field not required, when I try to enter a booking without an email, I get an error asking to provide a valid email address.

    Is there a way to allow someone to book without an email address? Some of the people registering may not have one.

    Leah McCloskey
    #32047

    Hi Leah,

    At this point the email is required unless the user is logged-in. You can remove the email programatically with:

    add_action( 'eventorganiser_get_event_booking_form', function($form) {
        $form->remove_element( 'email' );
    } );
    

    But this will only stop the email from being displayed: but bookings will be rejected. To prevent that you can do one of two things:

    Edit the code to remove lines 292 and 293 from includes/booking-actions.php which reads:

        if ( !is_email( $email ) ) {
            $form->add_error( 'invalid_bookee_email', __( 'Please provide a valid email address.', 'eventorganiserp' ) );
    

    or, hook into eventorganiser_validate_booking_submission with priority 9 or lower, and re-add the email field, setting a dummy value.

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.