• Resolved kirschdaniel

    (@kirschdaniel)


    I want to receive an email as soon as someone booked an event. So far I only receive an email if I select “Approval required”.
    I found the option “Email the owner of the event” in the email settings. But this is allready set to “YES” but I don’t get any message. (the mail to the user gets send correctly)

    Thanks for help
    Daniel

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    just to confirm, are you the author or admin ?

    Thread Starter kirschdaniel

    (@kirschdaniel)

    Finally I’m both the admin and the author and responsible person for the event.

    Have you tried using a different email address for one of those?

    Thread Starter kirschdaniel

    (@kirschdaniel)

    I havn’t tried adding a second person to check your suggestion.

    So far I’ve used the following in my functions.php

    // Send mails when a booking happened
    add_action('em_booking_add', function($EM_Event) {
      global $EM_Booking;
      $msg = "New booking\n" .
        "'" . $EM_Event->event_name . "' at " . 
        $EM_Event->event_start_date .
        "\n\nDETAILS:\n" .
        $_REQUEST['user_name'] . "\n".
        $_REQUEST['user_email'] . "\n".
        $_REQUEST['dbem_phone'] . "\n\n".
        "User comment:\n'" .
        $EM_Booking->booking_comment . "'\n";
    
      $msg = wordwrap($msg, 70);
    
      // Send mail
      mail('[email protected]', 'New booking', $msg);
    });

    Not elegant but working. Instead of using the $_REQUEST object to retrieve the information, I’ve also tried to use the $EM_BOOKING object, but at the time the “em_booking_add” action gets fired, the $EM_BOOKING object doesn’t contain all data.

    Cheers and thanks for the support
    Daniel

    • This reply was modified 7 years, 7 months ago by kirschdaniel. Reason: Format the code
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Get E-Mail for booking’ is closed to new replies.