• Resolved ivomasterche

    (@ivomasterche)


    Hello, I have a single event page with the #_BOOKINGBUTTON which works fine and creates a pending booking for registered and logged users, but it does not send the pending email neither to the admin email, nor to the event contact. Confirmation and cancellation emails are sent correctly.

    I have tried with WP Safe Mode.

    I have tried to check/uncheck the event owner checkbox and to use another emails for the owner and the admin, with no success.

    WordPress Version 6.3.1.

    Events Manager 6.4.5.1.

    I am using WP_mail and did not test other options here, since other emails are sent correctly.

    • This topic was modified 1 year, 6 months ago by ivomasterche.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter ivomasterche

    (@ivomasterche)

    Hello and thank you very much for the fast reply.

    In my configuration the Pending email subject is set, I even tried to remove all the content on the email and left just a single word but it is still not sent.

    Additionally just for the test I set the bookings approval to “not required” and again received the confirmation email, turned the approval required on, and “pending booking” email is not received.

    You need to set the Administrator Email in order to have the pending event emails sent out.

    Thread Starter ivomasterche

    (@ivomasterche)

    Thank you once again for your answer.

    First of all you have put a screenshot of the Event Submission Template, which I believe is responsible for the event submission, not booking. Anyway I have tried this but with no result. I have already set the administrator email in the booking email module.

    Since nothing of that worked, I did some digging in the code and I noticed that admin emails are submitted only if the booking status is changed.

    As you can see in em-bookings.php line 3273:

    if( $this->booking_status !== $this->previous_status || $force_resend ){... send email}

    I realized that when you make a new booking, this will always evaluate to false, since both booking_status and previous_status are the same – 0. I have temporarily fixed my issue hacking the code to

    if( $this->booking_status === 0 || $this->booking_status !== $this->previous_status || $force_resend ){... sendemail}

    but maybe there is a better solution? Please advice.

    I didn’t read your initial post carefully. You’re correct about the reason that emails are not being sent when the booking is pending. You can fix this without modifying the plugin code by using the em_booking_email filter. You can create a code snippet like this:

    add_filter('em_booking_email', 'my_em_booking_email', 10, 6);
    function my_em_booking_email( $result, $EM_Booking, $email_admin, $force_resend, $email_attendee) {
       // here copy the code from the function EM_Booking::email starting with the if statement block from line 1639 throough line 1659 and then return $result (of course you need to modify the if condition) 
    }

    When you copy the code you would need to repace all occurrences of $this with $EM_Booking.

    • This reply was modified 1 year, 6 months ago by joneiseman.
    Thread Starter ivomasterche

    (@ivomasterche)

    Thank you very much.

    I was so concentrated into finding the issue, that I did not see the filter, (great coding btw)

    Could you please just clarify, whether this issue will be considered as a bug and fixed in future releases?

    Additionally during my tests with different settings, I realized that when I enable the “Add Reply-To event owner?” the attendees stopped receiving their booking emails. I could open a separate topic regarding this, but since it was just a test, and I actually don’t use this feature I am mentioning it here just as feedback. I followed the issue to the $args variable – if I pass empty array the attendee received the email.

    Anyway, thank you once again for the great support.

    I believe it’s a bug. I’m not the plugin developer so I don’t know if or when this will be fixed.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Issue with pending booking email’ is closed to new replies.