READ FIRST: This code needs to be added at the end of the functions.php file. If you are familiar with editing functions.php, feel free to continue reading. If you haven’t done this before, adding this code in the wrong place might bring the site down and the only way to access it is by editing functions.php file again via FTP. Feel free to contact us if you need help!
If you want to generate a coupon code and send an email with a coupon on some other order status than Complete, you need to add this code to functions.php file:
function gens_raf_change_status( $status ) {
$status = "processing";
return $status;
}
add_filter('wpgens_raf_order_status', 'gens_raf_change_status');