Skip to content

Instantly share code, notes, and snippets.

@skyshab
Last active August 2, 2021 22:39
Show Gist options
  • Save skyshab/02df7de02b68d188bb2338fd3f12e6ae to your computer and use it in GitHub Desktop.
Save skyshab/02df7de02b68d188bb2338fd3f12e6ae to your computer and use it in GitHub Desktop.
Add organizer email to ticket emails
<?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