zc 1.57d, php 7.4

Our site was upgraded from 1.3.9 to 1.5.7 back in 2020. Since then, we have not received one 10486 error by email, but I can only find it in the log folder occasionally. We can still receive 15005 error by both email and log files occasionally, which is very convenient for us to contact customers manually. I hope we can still receive 10486 error by email, like before.

I did some studies.

The subject of 15005 error email is "ALERT: PayPal Direct Payment Error (15005)", which is related to the parameter "MODULE_PAYMENT_PAYPALDP_TEXT_EMAIL_ERROR_SUBJECT"

The subject of previous 10486 error email is "ALERT: PayPal Express Checkout Error (10486)", which is related to the parameter "MODULE_PAYMENT_PAYPALWPP_TEXT_EMAIL_ERROR_SUBJECT"

Then I compared the related sections in both new and old version paypalwpp.php files. Here is what I found:

1. "MODULE_PAYMENT_PAYPALWPP_TEXT_EMAIL_ERROR_SUBJECT" is mentioned three times, for three similar sections.

2. In old paypalwpp.php file, three sections are the following:

if ($detailedEmailMessage != '') zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, MODULE_PAYMENT_PAYPALWPP_TEXT_EMAIL_ERROR_SUBJECT . ' (' . zen_uncomment($errorNum) . ')', zen_uncomment($detailedMessage), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML'=>zen_uncomment($detailedMessage)), 'paymentalert');

if ($detailedEmailMessage != '') zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, MODULE_PAYMENT_PAYPALWPP_TEXT_EMAIL_ERROR_SUBJECT . ' (' . zen_uncomment($errorNum) . ')', zen_uncomment($detailedMessage), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML'=>zen_uncomment($detailedMessage)), 'paymentalert');

if ($detailedEmailMessage != '') zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, MODULE_PAYMENT_PAYPALWPP_TEXT_EMAIL_ERROR_SUBJECT . ' (' . zen_uncomment($errorNum) . ')', zen_uncomment($detailedMessage), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML'=>nl2br(zen_uncomment($detailedEmailMessage))), 'paymentalert');

3. In new paypalwpp.php file, three sections are the following:
if ($detailedEmailMessage != '') zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, MODULE_PAYMENT_PAYPALWPP_TEXT_EMAIL_ERROR_SUBJECT . ' (' . $this->uncomment($errorNum) . ')', $this->uncomment($detailedEmailMessage), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML'=>$this->uncomment($detailedMessage)), 'paymentalert');

if ($detailedEmailMessage != '') zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, MODULE_PAYMENT_PAYPALWPP_TEXT_EMAIL_ERROR_SUBJECT . ' (' . $this->uncomment($errorNum) . ')', $this->uncomment($detailedEmailMessage), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML'=>$this->uncomment($detailedMessage)), 'paymentalert');

if ($detailedEmailMessage != '') zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, MODULE_PAYMENT_PAYPALWPP_TEXT_EMAIL_ERROR_SUBJECT . ' (' . $this->uncomment($errorNum) . ')', $this->uncomment($detailedMessage), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML'=>nl2br($this->uncomment($detailedEmailMessage))), 'paymentalert');

4. In new paypaldp.php file, two related sections are the following:

zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, MODULE_PAYMENT_PAYPALDP_TEXT_EMAIL_ERROR_SUBJECT . ' (' . zen_uncomment($errorNum) . ')', zen_uncomment($detailedEmailMessage), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML'=>nl2br(zen_uncomment($detailedEmailMessage))), 'paymentalert');

if ($detailedEmailMessage != '') zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, MODULE_PAYMENT_PAYPALDP_TEXT_EMAIL_ERROR_SUBJECT . ' (' . zen_uncomment($errorNum) . ')', zen_uncomment($detailedMessage . $explain), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML'=>nl2br(zen_uncomment($detailedEmailMessage))), 'paymentalert');


5. Other than the syntax changes, the pattern for three sections of the old file (paypalwpp.php) is the following:
...$detailedMessage...$detailedMessage...
...$detailedMessage...$detailedMessage...
...$detailedMessage...$detailedEmailMessage...

the pattern for three sections of the new file (paypalwpp.php) is the following:
...$detailedEmailMessage...$detailedMessage...
...$detailedEmailMessage...$detailedMessage...
...$detailedMessage...$detailedEmailMessage...

the pattern for three sections of the new file (paypaldp.php) is the following:
...$detailedEmailMessage...$detailedEmailMessage...
...$detailedMessage...$detailedEmailMessage...

6. I'm not sure if I change the new paypalwpp.php to the following pattern will fix my issue or not:
...$detailedMessage...$detailedMessage...
...$detailedMessage...$detailedMessage...
...$detailedMessage...$detailedEmailMessage...