Hi @johnegg,
First solution that comes to mind – rewrite WooCommerce email templates in your theme. Actually, standard processing email text (“Just to let you know — we’ve received your order…”) is hardcoded in the template, so I don’t see any other option for this.
So what you need to do:
1. Leave “Email instructions” option empty in custom gateway’s settings. This way it won’t appear in manual invoice emails and won’t interfere with our customizations below.
2. Copy customer-processing-order.php
file from \wp-content\plugins\woocommerce\templates\emails
to \wp-content\themes\your_theme\woocommerce\emails
. Ideally your_theme
would be a child theme – this way customizations won’t disappear after theme update.
3. Open copied customer-processing-order.php
file in your theme folder (e.g. with FTP) and change line 30 from:
<p><?php printf( esc_html__( 'Just to let you know — we\'ve received your order #%s, and it is now being processed:', 'woocommerce' ), esc_html( $order->get_order_number() ) ); ?></p>
to something like this:
<p><?php
if ( 'alg_custom_gateway_1' === $order->get_payment_method() ) {
echo 'Your email instructions here...';
} else {
printf( esc_html__( 'Just to let you know — we\'ve received your order #%s, and it is now being processed:', 'woocommerce' ), esc_html( $order->get_order_number() ) );
}
?></p>
here we are outputting different text (“Your email instructions here…”) for orders made with alg_custom_gateway_1
payment gateway.
Hope you get the idea. Please let me know if you have any questions.