Hi Stephen,
One of my clients would like to be able to set separate booking notification addresses by event (or at the very least, by booking form). This is because they have a number of different event organisers who would like to receive notifications.
Hope that makes sense…
Andrew
Andrew Shankie
I think in 1.7 there’ll be an option to “notify the event organiser” instead of / as well as the site’s admin. But assuming the user to be notified is the ‘event organiser’ then you can do that with the code in this thread on changing the notification emails.
If not, you can alter that code to the do the following:
add_filter( 'eventorganiser_booking_notification_email', 'my_booking_notification_email', 10, 2 );
function my_booking_notification_email( $emails, $booking_id ){
//Get the event ID and organiser ID
$event_id = eo_get_booking_meta( $booking_id, 'event_id' );
$notify = get_post_meta( $event_id, 'notify_emails' );
//If emails to be notified is present, use that, otherwise fall back to $emails
$emails = $notify ? $notify : $emails;
return $emails;
}
And then just use the custom fields metabox for the event to specify e-mail addresses to be notified, using the key notify_emails
Stephen Harris
Is this technique compatible with the ‘Event Organiser Booking Notification Settings’ plugin? Or, should that be disabled in favor of this?
Alan Caplan
Hi Alan,
The Booking Notification Settings plug-in allows you to add specific e-mail addresses to including in the notifications, as well as notifying the event organiser. So if that plug-in does what you require, you should definitely use that.
This snippet allows you to specify the e-mails to be notified on an event-by-event basis, but it’s the event organiser (author) you may as well use the plug-in. This snippet would be useful for anything more complicated.
Stephen Harris