Skip to content

Instantly share code, notes, and snippets.

@niconerd-zz
Forked from skyshab/example.php
Last active April 9, 2019 21:35
Show Gist options
  • Save niconerd-zz/c4638adad78f22c4649afcfbb5dc1c3d to your computer and use it in GitHub Desktop.
Save niconerd-zz/c4638adad78f22c4649afcfbb5dc1c3d to your computer and use it in GitHub Desktop.
Add organizer email to ticket emails
<?php
function modify_woo_ticket_headers( $header, $id, $object ) {
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 ) ) {
$header .= "Cc: " . $organizer_email . "\r\n";
}
return $header;
}
function before_woo_tickets_sent() {
add_filter( 'woocommerce_email_headers', 'modify_woo_ticket_headers', 10, 3 );
}
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