dgtlmoon / changedetection.io

The best and simplest free open source web page change detection, website watcher, restock monitor and notification service. Restock Monitor, change detection. Designed for simplicity - Simply monitor which websites had a text change for free. Free Open source web page change detection, Website defacement monitoring, Price change notification
https://changedetection.io
Apache License 2.0
16.02k stars 891 forks source link

[feature] Different notification settings for different apprise services #2316

Open TJWeiten opened 3 months ago

TJWeiten commented 3 months ago

Version and OS v0.45.17 on docker

Is your feature request related to a problem? Please describe. Right now, I am using two different notification services to alert me to changes: LINE (a messaging app) and Mailgun (to send e-mails). The two different services have very different structures/capabilities with regards to the messages I send. For instance, over e-mail, I can get away with sending {{diff}}'s, but for the messaging app nature of LINE, sending the differences makes little sense.

As such, it would be nice to be able to configure notification settings on a per apprise protocol basis.

Describe the solution you'd like A cheap workaround solution that almost worked was to create two group tags, one called LINE and another called E-mail. When creating a watch url, you can plug in the two groups separated by commas, and ChangeDetection.io appears to handle this relatively well (the watch URL appears in both groups). Then for each group, I configured a different notification setting—each with its own apprise protocol and unique message configured.

However, this does not work. I haven't looked at the code, but it appears that ChangeDetection.io will only select whatever it orders the first group to (in my case, it's LINE) and sends notifications based on that group, but will not send notifications for the other groups that the watch url is attached to.

Of course, this was more of a hacky workaround that I tried that could probably be made to work relatively quickly.

A more 'ideal' solution would be to change the notifications settings system more substantially such that you can 'Create new notification message' and then for each method, have a multi-attribute selector form that allows you to choose which services from the line-separated apprise protocols the user has plugged in that that notification message should be sent to.

dgtlmoon commented 3 months ago

However, this does not work. I haven't looked at the code, but it appears that ChangeDetection.io will only select whatever it orders the first group to (in my case, it's LINE) and sends notifications based on that group, but will not send notifications for the other groups that the watch url is attached to.

that sounds like a bug, so you're saying if you have 2 groups set on a watch, and each group has different notifications, it only sends the first one?

A more 'ideal' solution would be to change the notifications settings system more substantially such that you can 'Create new notification message' and then for each method, have a multi-attribute selector form that allows you to choose which services from the line-separated apprise protocols the user has plugged in that that notification message should be sent to.

100% correct - the problem now is that notifications are 1:1 with the watch, the 'groups' thing helps a bit but its still not quite the right answer

TJWeiten commented 2 months ago

that sounds like a bug, so you're saying if you have 2 groups set on a watch, and each group has different notifications, it only sends the first one?

Correct, at least that is what appears to be happening. I have a test watch URL I put into the E-mail group alone. When it changes, it sends an e-mail using Mailgun correctly. When I put "E-mail, LINE" in the group tags (in that order), LINE becomes the first in the list:

CleanShot 2024-04-18 at 09 24 06

And new changes will only come through LINE, not e-mail (which, also as a minor side-point, there's no way to distinguish between the multiple tags with how its rendered right now—a quick and easy CSS fix to that could be to change .watch-tag-list's background and add some padding).

CleanShot 2024-04-18 at 09 32 55@2x

.watch-tag-list {
  color: var(--color-white);
  white-space: nowrap;
  background: var(--color-text-watch-tag-list);
  border-radius: 5px;
  padding: 2px 5px;
}

Just a thought. :)