-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
add support to specify multiple recipients per URL #781
Comments
Right now, reporter-related configuration per job isn't possible. You have to rely on having multiple configurations and/or set up mailing lists or something. Because reports are grouped (so there's only one notification sent out if both are changed) it wouldn't even be possible without some additional logic to split reports in those cases (e.g. in your example, would Possibly related to #507. |
Thanks for the feedback.
FYI, I have a working implementation to split reports in separate emails. |
Trying to rebase before PRing, I discover the existence of new option "separate", urlwatch/lib/urlwatch/reporters.py Line 130 in e342af9
Can this be used to send one email per report? |
This just sends multiple e-mails to the single recipient instead of a single mail with all update notifications combined. Yes, in this case it would be possible to have multiple recipients, but it means that having multiple recipients would enable It's still tricky, as the way recipients are specified is specific to the reporter (e.g. e-mail reporter takes e-mail adresses, the Slack reporter takes a URL, the Telegram reporter takes something else, etc...). |
I'm trying to use the Neither top-level nor under report works. report:
email:
enabled: true
separate: true any suggestion? Thanks! |
Have a working version with adding the optional field job_defaults:
all:
to: '[email protected]' ---
kind: url
url: https://www.monperrus.net/martin/random.php
to: [email protected],[email protected] --- a/lib/urlwatch/jobs.py
+++ b/lib/urlwatch/jobs.py
class Job(JobBase):
__required__ = ()
- __optional__ = ('name', 'filter', 'max_tries', 'diff_tool', 'compared_versions', 'diff_filter', 'treat_new_as_changed', 'user_visible_url')
+ __optional__ = ('name', 'filter', 'max_tries', 'diff_tool', 'compared_versions', 'diff_filter', 'treat_new_as_changed', 'user_visible_url','to') and --- a/lib/urlwatch/reporters.py
+++ b/lib/urlwatch/reporters.py
- msg = mailer.msg_html(self.config['from'], self.config['to'], subject, body_text, body_html)
+ msg = mailer.msg_html(self.config['from'], job_state.job.to, subject, body_text, body_html)
else:
- msg = mailer.msg_plain(self.config['from'], self.config['to'], subject, body_text)
+ msg = mailer.msg_plain(self.config['from'], job_state.job.to, subject, body_text)
|
I've got an alternative approach to this that enables multiple reporters of each type: #790 You would tag jobs and use them to select the right jobs for each reporter. |
Thanks for the great tool!
It would be super useful to specify different and possibly multiple recipients per URL.
for example:
WDYT?
The text was updated successfully, but these errors were encountered: