-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
feat(alerting): add email and click action to ntfy provider #778
Conversation
There are also other properties supported by ntfy, which are not implemented yet:
https://docs.ntfy.sh/publish/#publish-as-json There are also cache and firebase supported using the http request instead of JSON. That and other not implemented properties could be worked around via the custom provider for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but could you create a few tests?
@stendler WRT |
Sorry, I have not updated that comment but only the PR summary:
What kind of tests do you want to see here? For There does not seem to be a test for the request headers there yet. So either a test with a server receiving the request is needed or a refactor of the Send method into a buildRequest to be able to test for the headers. Which of these options do you think are best? |
@stendler A new case for |
@TwiN I've now added tests for the json properties and also tests for verifying the request headers from the Send function using httptest. |
This avoids the need for a pointer, as omitting these bools in the config defaults to false and omitting to set these headers will use the server's default - which is enabled on ntfy.sh
@stendler Thank you for the contribution! |
Summary
Adds the email and click properties to the ntfy provider.
Documentation to publishing on ntfy via JSON: https://docs.ntfy.sh/publish/#publish-as-json
Edit: Now also adds the properties
firebase
andcache
, which currently cannot be defined in JSON but as http headers (binwiederhier/ntfy#1119).Checklist
README.md
, if applicable.