Last active
August 2, 2021 22:39
-
-
Save skyshab/02df7de02b68d188bb2338fd3f12e6ae to your computer and use it in GitHub Desktop.
Add organizer email to ticket emails
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 | |
function modify_woo_ticket_headers( $headers, $id ) { | |
remove_filter( 'woocommerce_email_headers', 'modify_woo_ticket_headers' ); | |
$organizer_email = tribe_get_organizer_email( $id, false ); | |
// add organizer email if it's a valid email address | |
if ( is_email( $organizer_email ) ) { | |
$headers[] = sprintf( 'Cc: %s', $organizer_email ); | |
} | |
return $headers; | |
} | |
function before_woo_tickets_sent() { | |
add_filter( 'woocommerce_email_headers', 'modify_woo_ticket_headers', 10, 2 ); | |
} | |
add_action( 'wootickets-send-tickets-email', 'before_woo_tickets_sent', 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment