Daily Lucky Numbers:
9
13
14
37
42
48

Undefined array key "resend_pending_message_subject"

Started by Duban Black, May 05, 2025, 07:41:44 PM

Previous topic - Next topic

Duban Black

Today I got a new error when registering a high score and therefore a new champion in the Aquacubes game, it seems to me that the error is related to the sending of mails.

I leave the detail:

#0: smf_error_handler()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/ZhenMailerHooks.php en línean 433
#1: ZhenMailTemplates()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/Subs-Post.php en línean 3008
#2: loadEmailTemplate()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/ArcadeSources/Subs-Arcade.php en línean 773
#3: arcadeEvent()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/ArcadeSources/Subs-Arcade.php en línean 1277
#4: SaveScore()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/ArcadeSources/ArcadeGame.php en línean 939
#5: ArcadeSubmit()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/Arcade.php en línean 879
#6: Arcade()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/ArcadeHooks.php en línean 92
#7: Arcade_game_support()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/Subs.php en línean 5798
#8: call_integration_hook()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/index.php en línean 269
#9: smf_main()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/index.php en línean 196

Line 433:

$txt[$email . '_subject'] = !empty($zhenMailModSettings['zhen_' . $email . '_subject']) ? ZhenMailer_decode($zhenMailModSettings['zhen_' . $email . '_subject']) : $txt[$email . '_subject'];
The mail arrived correctly although it did not arrive in the conventional Zenhmailer format that uses default templates.



Chen Zhen


You posted the error trace which doesn't actually tell me the error from line 433 of ZhenMailerHooks.php.
Show me the type of error that was flagged for line 433.


Duban Black

#2
I will leave the detail of the first 3 errors, they are 92:

Error 1:
Tipo de error
Undefined_vars
Mensaje de Error
2: Undefined array key "msg_quote_body"
Archivo
/home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/ZhenMailerHooks.php
Línea
434
URL de la página causante del error
https://harrypotterhead.com/foro/index.php?act=Arcade&do=newscore

#0: smf_error_handler()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/ZhenMailerHooks.php en línean 434

Line 434 of function ZhenMailTemplates()           

$txt[$email . '_body'] = !empty($zhenMailModSettings['zhen_' . $email . '_body']) ? ZhenMailer_decode($zhenMailModSettings['zhen_' . $email . '_body']) : $txt[$email . '_body'];
Error 2:
Tipo de error
Undefined_vars
Mensaje de Error
2: Undefined array key "msg_quote_subject"
Archivo
/home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/ZhenMailerHooks.php
Línea
433
URL de la página causante del error
https://harrypotterhead.com/foro/index.php?act=Arcade&do=newscore

#0: smf_error_handler()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/ZhenMailerHooks.php en línean 433

Line 433 of    function ZhenMailTemplates()

$txt[$email . '_subject'] = !empty($zhenMailModSettings['zhen_' . $email . '_subject']) ? ZhenMailer_decode($zhenMailModSettings['zhen_' . $email . '_subject']) : $txt[$email . '_subject'];
Error 3:
Tipo de error
Undefined_vars
Mensaje de Error
2: Undefined array key "paid_subscription_error_body"
Archivo
/home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/ZhenMailerHooks.php
Línea
434
URL de la página causante del error
https://harrypotterhead.com/foro/index.php?act=Arcade&do=newscore

#0: smf_error_handler()
Llamado desde /home/u964766853/domains/harrypotterhead.com/public_html/foro/Sources/ZhenMailerHooks.php en línean 434

$txt[$email . '_body'] = !empty($zhenMailModSettings['zhen_' . $email . '_body']) ? ZhenMailer_decode($zhenMailModSettings['zhen_' . $email . '_body']) : $txt[$email . '_body'];
This error is repeated for each variable used by zhenmailer:

2: Undefined array key "paid_subscription_new_subject"
2: Undefined array key "paid_subscription_refund_body"
2: Undefined array key "paid_subscription_refund_subject"
2: Undefined array key "admin_attachments_full_body"
2: Undefined array key "admin_attachments_full_subject"
2: Undefined array key "admin_notify_approval_body"
2: Undefined array key "admin_notify_approval_subject"
2: Undefined array key "notification_split_body"
.
.
.
2: Undefined array key "resend_pending_message_subject"

When you want to send an email with arcade notifications 92 errors are generated, which are all the variables used by zhenmailer

Chen Zhen

#3
My apologies for the late response as I've been preoccupied with work as of late.

This is a ZhenMailer issue & not really an Arcade issue.
Please use the attachment to replace the ZhenMailer hooks file and let me know if it corrects the undefined errors.

This file belongs in the ./Sources path.




Duban Black

@Chen Zhen  It's working ok, no more errors occur, but the emails are sent outside the ZhenMailer format, is there a way to include them in the default templates?

Chen Zhen


ZhenMailer only filters SMF's default email templates and not any emails from custom modifications.
However, "Precursory" & "Signature" should be working for all emails.
   

Duban Black

Quote from: Chen Zhen on June 22, 2025, 12:33:02 AMZhenMailer only filters SMF's default email templates and not any emails from custom modifications.
However, "Precursory" & "Signature" should be working for all emails.
   

"Precursory" & "Signature" do not work in this type of email, it seems to me that it does not follow the regular sending flow that is SMTP and that is currently used with ZhenMailer. On the contrary the email sending in Arcade is by (PHP default). Even the sending email which is the same looks different in both emails, attached evidence.

Mail sent by zhenmailer (smtp)

Mail sent by Arcade (I assume it is php default)

Where in the arcade code could I change the email sending and configure smtp instead of php default?

Chen Zhen

If you don't mind testing a possible fix, please download the attached file and overwrite the existing file located in this path:
\ArcadeSources




Please let me know if it resolves your reported issue.

Chen Zhen


Please read this post:
https://web-develop.ca/index.php?topic=3933.msg12165

The changes to Zhen Mailer files from this thread are already included in the ZhenMailer package that is in WebDev's download section.