How do I use the "Change booking notification email" feature

WordPress Event Management, Calendars & Registration Forums General Question How do I use the "Change booking notification email" feature

This topic contains 7 replies, has 3 voices, and was last updated by  JB Woodruff 10 years, 3 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #9315

    I’m very interested in adding an additional email to receive a notification when an event is booked; however, the documentation does not state where I need to add/modify this code. Can you please point me in the right direction of where to modify the code?

    Regards,

    JB

    JB Woodruff
    #9320

    Are you referring to this post? The referenced code should (ideally) go in a seperate plug-in, but it will also work in your theme’s functions.php. (There’s more details on this here: wp-event-organiser.com/blog/tutorial/where-should-i-put-code-from-the-tutorials/)

    Stephen Harris
    #9331

    That is the post/feature that I’m referring to. Given that code, is it possible to enter a specific email address vs. having it use the post author’s email address? I’m assuming I need to enter it in this piece of code in the $emails line; however, I don’t know the correct syntax to add a specific email address. Can you please help? example would be test@123.com that I want to add.

    //If the user exists, add their email to notify both organiser and admin
    if( $user_obj ){
    $emails[] = $user_obj->user_email;
    }

      return $emails;      
    JB Woodruff
    #9333

    I believe that this should work:

    add_filter( 'eventorganiser_booking_notification_email', 'my_booking_notification_email', 10, 2 );
    function my_booking_notification_email( $emails, $booking_id ){
    
          //Add extra email address to array
          $emails[] = 'test@123.com';
    
          return $emails;        
    }
    • This reply was modified 10 years, 3 months ago by  Stephen Harris.
    Dario
    #9339

    Thank you again for your help with this.

    I added this to the functions.php in my theme; however, it made my site go blank. Figured I’d need to add a ?> to the end, but that didn’t seem to fix things. Any thoughts?

    Regards,

    JB

    JB Woodruff
    #9342

    Your functions.php file should start with <?php and end with ?> with the above code in the middle.

    Or you could put it into your own custom utility plugin (which is the recommended way anyway) — see this tutorial.

    I’m pretty sure that the modified code should work, but I haven’t tested it, will test later in the week when I have some free time if this issue hasn’t been resolved.

    Dario
    #9345

    Both my original post, and Dario’s were missing a comma in between 'eventorganiser_booking_notification_email' and “’my_booking_notification_email’` (now corrected). The code snippets should work ok now.

    Stephen Harris
    #9413

    Works like a charm. Thank you very much for your help with this one.

    JB Woodruff
Viewing 8 posts - 1 through 8 (of 8 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.