• Resolved aquumcreative

    (@aquumcreative)


    Hi,
    Client has asked to have the Gift Card code within the New Order Email so they do not need to make the extra step to log into the website to get this info to add to their POS. Is there some code that I can add to do this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author pimwick

    (@pimwick)

    Unfortunately the gift card number isn’t available until the order is marked Complete so it can’t be included in the New Order email.

    Thread Starter aquumcreative

    (@aquumcreative)

    Thanks for getting back to me!
    Can we instead bcc the admin in the customer gift voucher email which would then include the Gift Card code?

    Plugin Author pimwick

    (@pimwick)

    You can follow these steps to blind-carbon-copy or carbon-copy an email address:

    1. Download the functions.php from your FTP server at /wp-content/themes/<your theme>/functions.php
    2. Keep a backup of functions.php in case there are problems.
    3. Edit functions.php and scroll to the very end and add this code.

    Note: if the last line is “?>” then put this code *above* that line. Otherwise, this code goes at the very end of the file:

    function custom_woocommerce_email_headers( $header, $email_id, $gift_card ) {
        // Only for "PW Gift Card" email notification
        if( 'pwgc_email' !== $email_id ) {
            return $header;
        }
    
        // Set the email address to be copied.
        $formatted_email = utf8_decode( 'Your Name <your@email.com>' );
    
        $header .= "Bcc: " . $formatted_email . "\r\n";
    
        return $header;
    }
    add_filter( 'woocommerce_email_headers', 'custom_woocommerce_email_headers', 10, 3 );

    4. Save the functions.php file and re-upload it to your server.

    Replace functions.php with your backup file if you have any problems.

    If you want to “Carbon-Copy” rather than “Blind Carbon-Copy”, change the “Bcc” to be “Cc” in the code above.

    Let me know if you have any questions!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Gift Card Code in Order Email’ is closed to new replies.