Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Created January 30, 2016 01:18
Show Gist options
  • Save cliffordp/74b66ceb1a15ce025e7f to your computer and use it in GitHub Desktop.
Save cliffordp/74b66ceb1a15ce025e7f to your computer and use it in GitHub Desktop.
Send Event Tickets RSVP/purchase email to multiple recipients (e.g. site admin email or custom email) -- NOTE: sends to all recipients in single email (not CC or BCC, which would be preferable)
<?php
// From https://gist.github.com/cliffordp/74b66ceb1a15ce025e7f
// Send Event Tickets RSVP/purchase email to multiple recipients (e.g. site admin email or custom email)
// NOTE: sends to all recipients in single email (not CC or BCC, which would be preferable)
// @link: https://github.com/moderntribe/event-tickets/blob/release/122/src/Tribe/RSVP.php#L373
add_filter( 'tribe_rsvp_email_recipient', 'cliff_event_tickets_email_copy_to_admin', 30 );
function cliff_event_tickets_email_copy_to_admin( $to ) {
$additional_recipients = array(
get_option( 'admin_email' ), // admin's email
// 'me@example.com', // custom entry
);
if ( is_string( $to ) ) {
$additional_recipients[] = $to;
$to = $additional_recipients;
} elseif ( is_array( $to ) ) {
array_merge( $to, $additional_recipients );
} else {
//
}
return $to;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment