Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Unable to send subscription expiration reminder,there is an error in PHP #717

Open
rainpaper-bs opened this issue Jan 30, 2025 · 5 comments

Comments

@rainpaper-bs
Copy link

I configured ntfy as the notification service, and it has been enabled. After clicking the test button, I found that notifications can be sent normally. This proves that my notification configuration is correct. Next, I added a test subscription, and its content is as follows.
Image
The date I tested is 2025/01/30, which should send a notification today because I set it one day in advance. However, I did not receive any notification. An error occurred after manually running the scheduled task "Send Notifications" in the Admin panel, the content is as follows:

For user: RainPaper
Next payment date: January 31, 2025
Current date: January 30, 2025
Difference: 1

Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /var/www/html/endpoints/cronjobs/sendnotifications.php:545
Stack trace:
#0 /var/www/html/endpoints/cronjobs/sendnotifications.php(545): array_keys(NULL)
#1 {main}
thrown in /var/www/html/endpoints/cronjobs/sendnotifications.php on line 545

I don't know what the problem is, I have no leads, can you help me?

@rainpaper-bs rainpaper-bs changed the title [Bug] Unable to send subscription expiration reminder [Bug] Unable to send subscription expiration reminder,there is an error in PHP Jan 30, 2025
@ellite
Copy link
Owner

ellite commented Feb 5, 2025

Hi. Sorry for the delay.
That error means that the custom headers for ntfy are not in the correct format.

@rainpaper-bs
Copy link
Author

However, I did not define custom headers, and the custom header is empty

@rainpaper-bs
Copy link
Author

I think the custom header should be in JSON format, because I don't need a custom header, so I entered {}, solved the problem, and everything works fine. But when I don't fill it in, there is a problem, which needs to be optimized.

@rainpaper-bs
Copy link
Author

rainpaper-bs commented Feb 8, 2025

It should be set to {} by default in the backend of the program when not filled in

@rainpaper-bs
Copy link
Author

And, I have a new suggestion. Notification content should be translated according to the user's language, these important notifications need to be read as soon as possible. Using the user's native language can help users understand the information more quickly and conveniently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants