By default, we only send the gift card email once the order has been marked Complete. Follow these instructions to create and email the gift card when the order is received instead:
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_order_status_processing( $order_id, $order ) {
global $pw_gift_cards_purchasing;
$pw_gift_cards_purchasing->add_gift_cards_to_order( $order_id, $order, "order_id: $order_id completed" );
}
add_action( 'woocommerce_order_status_processing', 'custom_woocommerce_order_status_processing', 11, 2 );
4. Save the functions.php file and re-upload it to your server.
If you have any problems, replace functions.php with your backup file.
Let me know if you have any questions!