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

Notification Level for Check In only #280

Open
spacezorro opened this issue Jul 3, 2024 · 6 comments · May be fixed by #328
Open

Notification Level for Check In only #280

spacezorro opened this issue Jul 3, 2024 · 6 comments · May be fixed by #328
Labels
enhancement New feature or request

Comments

@spacezorro
Copy link

Description

I want to send all notifications to Email but have successful/failed checkins only go to SMS

Where 1 is everything, 2 is successful checkins/errors, and 3 is errors only
I want to do
{
"notification_level": 1,
"notification_urls": "mailtos://ALLthestuffgoeshere",
"accounts": [
{
"username": "1234567", "password": "hunter2", "notification_level": 2,
"notification_urls": "sns://gobbledegook/us-west-1/+15555551212"
},
{
"username": "7654321", "password": "hunter2", "notification_level": 2,
"notification_urls": "sns://gobbledegook/us-west-1/+15555552222"
}

etc...

That way it keeps the SMS to a minimum instead of SMS bombing someone when the server/docker restarts

What alternatives have you considered?

No response

@spacezorro spacezorro added the enhancement New feature or request label Jul 3, 2024
@jdholtz
Copy link
Owner

jdholtz commented Jul 4, 2024

Yes, this is a good feature to add. I’ll add it in the same release as the notifications I explained in #249 which will be by next release.

@davidkassa
Copy link
Contributor

davidkassa commented Jul 4, 2024

If you're considering updating notifications, can you make the notification_level and url paired? For example:
{
"username": "7654321", "password": "hunter2",
"notifications": [
{ "notification_level": 1, "notification_urls": "sns://gobbledegook/us-west-1/+15555551111"}, // admin number / notification
{ "notification_level": 4, "notification_urls": "sns://gobbledegook/us-west-1/+15555554444"} // family number / notification
]
}

jdholtz added a commit that referenced this issue Jul 4, 2024
This change will be part of another PR as the details of #280 are still
being figured out.
@jdholtz
Copy link
Owner

jdholtz commented Jul 4, 2024

If you're considering updating notifications, can you make the notification_level and url paired?

I partly misunderstood the original feature request. I believe this is also what @spacezorro is requesting (there are 2 feature requests). I've reverted the changes done in #281 relating to this feature so this could be discussed further.

With the configuration provided by spacezorro, the account notification level would actually override the global level, meaning even the email notifications would be sent only error messages.

Here's what I'm thinking for how this will be specified for the config file. I don't want it to be too complicated either, so let me know what you guys think.

{
    "notifications": [{"url": "smtp://email"}],
    "accounts": [
        {"username": "...", "password": "...", "notifications": [
            {"url": "sms://text", "level": 2}, 
            {"url": "discord://channel"}
        ]},
        {"username": "...", "password": "..."}
    ]
}

For account 1, there would be notifications sent to three places (the levels will be based off of v7.5, not #281):

  • Email with level 1, SMS with level 2, and Discord with level 1

For account 2:

  • Email with level 1

Any level not specified will default to the current default notification level. If the same URL exists in both the account-specific and global notifications, the account-specific level will override the global level.

@spacezorro
Copy link
Author

That's perfect. I run the script for family and my wife/kids only want checkin messages. They don't care about the scheduling or fare checking... But I do so your most recent example is exactly what I was going for.

Does there need to be more levels for "checkin success/fail only"?

@jdholtz
Copy link
Owner

jdholtz commented Jul 4, 2024

Does there need to be more levels for "checkin success/fail only"?

Yes, I’ll add that as well. I’ll make a separate PR to add both this and the new config format.

@jdholtz
Copy link
Owner

jdholtz commented Jan 5, 2025

Both the notification check-in level and new notification configuration was added in #328. Would you guys be able to test it out and let me know how it works for you and if you have any issues? The new configuration should reflect my comment above, but documentation can be found for it in the CONFIGURATION.md doc (also let me know if this documentation should be improved). Thanks!

@jdholtz jdholtz linked a pull request Jan 5, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants