Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
Forked from cliffordp/functions.php
Created November 1, 2017 21:25
Show Gist options
  • Save andrasguseo/314219adf541e044a4e1569ce1ddb534 to your computer and use it in GitHub Desktop.
Save andrasguseo/314219adf541e044a4e1569ce1ddb534 to your computer and use it in GitHub Desktop.
BCC multiple email addresses, including the site admin email address, on all Event Tickets' RSVP ticket emails so they get a copy of it too
<?php
/**
* BCC multiple email addresses, including the site admin email address, on all Event Tickets' RSVP ticket emails so they get a copy of it too
*
* From https://gist.github.com/cliffordp/c4fb2ea8fb5ca44973ff06e6facc9742
* A fork of https://gist.github.com/cliffordp/4f06f95dbff364242cf54a3b5271b182
* For https://theeventscalendar.com/support/forums/topic/event-tickets-free-not-plus-rsvp-notifications/#post-1272819
*
* @link https://developer.wordpress.org/reference/functions/wp_mail/#comment-349
*/
function cliff_et_rsvp_bcc_admin_and_more_ticket() {
$bccs = array(
get_option( 'admin_email' ), // the site admin email, probably do not want to edit this line
'[email protected]', // edit or delete this line
'[email protected]', // edit or delete this line, and even add another if you want
);
// set Headers to Event Tickets' default
$headers = array( 'Content-type: text/html' );
// add each BCC email if it's a valid email address
foreach ( $bccs as $bcc ) {
$bcc = sanitize_email( $bcc );
if ( is_email( $bcc ) ) {
$headers[] = sprintf( 'Bcc: %s', $bcc );
}
}
return $headers;
}
add_filter( 'tribe_rsvp_email_headers', 'cliff_et_rsvp_bcc_admin_and_more_ticket' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment