Here is the problem. My woocommerce website has 3 different payment options -
- Check Payment
- Western Union
- Cash On Delivery
If my buyer checkout with "Check Payment" I want to send him an automated email that outlines the steps to make a check payment. If he checkout with "Western Union" I want to email him my Western Union information as an automated email. Another automated email should be send for Cash On Delivery.
Usually in Woocommerce you have a single email sent to customer for all completed orders, in my case I need 3 different emails depending on the payment option.
So I started using this tutorial to make a custom email - https://www.skyverge.com/blog/how-to-add-a-custom-woocommerce-email/
The tutorial above is used to make custom emails for expedited shipping. This is the line of code used for the same from the tutorial -
// bail if shipping method is not expedited
if ( ! in_array( $this->object->get_shipping_method(), array( 'Three Day Shipping', 'Next Day Shipping' ) ) )
return;
What will the line of code be if I want to check what the payment method is? I want to check if the payment method is "Check Payment" so that I can send him a custom email.
Please let me know if you have any idea.