Last active
May 18, 2022 04:12
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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, 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
Is there a way to make this work for the ticket emails generated after ticket purchase (not RSVP)? Thanks.