Email notification – template admin receives

WordPress Event Management, Calendars & Registration Forums General Question Email notification – template admin receives

This topic contains 3 replies, has 3 voices, and was last updated by  Stephen Harris 11 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7460

    Hey Stephen,

    I can’t seem to figure out where the email template for notifications that come to the admin is generated. I’m talking about the ones that I receive (New Event Booking and Booking Confirmed) when someone registers.

    I don’t allow user accounts, and the emails I get don’t notify me of the registrant’s name or any meta info that I’ve asked to have included in the registration form.

    I’d like to modify them to include those fields.

    Any help is appreciated!

    Thanks!
    Joe

    Joe Iadanza
    #7477

    Hi Joe,

    Admin (and bookee) emailing is handled in includes/booking-actions.php. In particular there is this function eventorganiser_notify_confirmed_booking() which sends an email out to the bookee (and maybe the admin too depending on the settings).

    You can hook into eventorganiser_notify_confirmed_booking and completely over-ride the function (it’s a filter, return false to over-ride).

    Unfortunately you can’t filter the email message to the admin in the same way you can the bookee (email is hardcoded inside that function), so you’ll need to essentially copy the contents of that function and change what you need to, and hook it on to the above mentioned filter:

    add_filter( 'eventorganiser_notify_confirmed_booking', 'joe_handle_confirmation_emails', 10, 2 );
    function joe_handle_confirmation_emails( $bool, $booking_id ){
    
         //Email user and admin  
    
         //Return false to abort the default function
        return false;
    }
    • This reply was modified 11 years, 3 months ago by  Stephen Harris.
    Stephen Harris
    #8561

    Stephen,

    I was trying to use the code snippet you included above but found that the add_filter statement should really be:

    add_filter( 'eventorganiser_notify_confirmed_booking', 'joe_handle_confirmation_emails', 10, 2 );

    i.e., add the filter with a priority of 10 and receiving two arguments. The remainder of the code is OK.

    All the best – Phil

    Phil Meades
    #8583

    Thanks Phil!

    You’re right – and I’ve updated my post to correct this.

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 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.