Add BCC for all tickets

Home Forums Ticket Products Event Tickets Plus Add BCC for all tickets

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #941988
    JG
    Participant

    Hi,

    Can I add a BCC address for all tickets that are being sent out?

    Thanks,
    JG

    #942000
    Barry
    Member

    Hi JG,

    Great question!

    Our ticket emails are sent out through WooCommerce, which in turn uses functionality baked into WordPress.

    Both of these provide opportunities to customize what is sent – not only in terms of the actual content but the recipient and any BCCs, etc.

    WooCommerce for instance provide the woocommerce_email_headers filter hook which lets you modify the email headers (thus you could add one or more BCCs). To target the ticket email specifically, you could first listen out for the wootickets-send-tickets-email action being fired, so the code would take this sort of shape:

    add_action( 'wootickets-send-tickets-email', 'listen_for_ticket_emails' );
    
    function listen_for_ticket_emails() {
        add_filter( 'woocommerce_email_headers', 'add_ticket_bcc' );
    }
    
    function add_ticket_bcc( $headers ) {
        // We don't want to impact on other emails,
        // so remove the callback immediately
        remove_filter( 'woocommerce_email_headers', 'add_ticket_bcc' );
    
        // (...insert your code to add a BCC here...)
    
        return $headers;
    }

    That’s not going to anything by itself – you’ll need to expand it a little to actually add the BCC addresses, but it hopefully gives you a general outline you can build on 🙂

    #946326
    Barry
    Member

    Hi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Add BCC for all tickets’ is closed to new replies.