Payment error still get email as a new order
https://www.prestashop.com/forums/topic/145578-payment-error-still-get-email-as-a-new-order/
under the modules/ps_mailalerts.php
around line 527
before the line of mail: send, please add my code.
Search Mail::send
//start -- edited @8Aug2022 avoid sending email to merchant if 'payment error' status
$mail_switch = false;
if ((int)$order_state->id != 8){
$mail_switch = true;
}
// if ($dir_mail) {
if ($dir_mail && $mail_switch) {
//end -- edited @8Aug2022