Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active May 18, 2022 04:12
Show Gist options
  • Save cliffordp/4f06f95dbff364242cf54a3b5271b182 to your computer and use it in GitHub Desktop.
Save cliffordp/4f06f95dbff364242cf54a3b5271b182 to your computer and use it in GitHub Desktop.
BCC site admin email on all Event Tickets' RSVP ticket emails so they get a copy of it too
<?php
/**
* BCC site admin email on all Event Tickets' RSVP ticket emails so they get a copy of it too
*
* From https://gist.github.com/cliffordp/4f06f95dbff364242cf54a3b5271b182
*
* Reference: https://developer.wordpress.org/reference/functions/wp_mail/#using-headers-to-set-from-cc-and-bcc-parameters
*
*/
function cliff_et_rsvp_bcc_admin_ticket() {
// get site admin's email
$bcc = sanitize_email( get_option( 'admin_email' ) );
// set Headers to Event Tickets' default
$headers = array( 'Content-type: text/html' );
// add BCC email if it's a valid email address
if ( is_email( $bcc ) ) {
$headers[] = sprintf( 'Bcc: %s', $bcc );
}
return $headers;
}
add_filter( 'tribe_rsvp_email_headers', 'cliff_et_rsvp_bcc_admin_ticket' );
@binarysprocket
Copy link

Is there a way to make this work for the ticket emails generated after ticket purchase (not RSVP)? Thanks.

@cliffordp
Copy link
Author

@binarysprocket, I just now saw your message.
Please open a ticket at https://theeventscalendar.com/support/forums/forum/event-tickets/event-tickets-plus/ with your question, including additional details of exactly what you're wanting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment