Code Monkey home page Code Monkey logo

Comments (7)

thp avatar thp commented on July 28, 2024

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 [email protected] get an e-mail with two changes, and [email protected] and [email protected] each get separate e-mails with their respective change?). Also, there are some reporters that don't have the concept of a "recipient".

Possibly related to #507.

from urlwatch.

monperrus avatar monperrus commented on July 28, 2024

Thanks for the feedback.

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

FYI, I have a working implementation to split reports in separate emails.

from urlwatch.

monperrus avatar monperrus commented on July 28, 2024

Because reports are grouped

Trying to rebase before PRing, I discover the existence of new option "separate",

if base_config.get('separate', False):

Can this be used to send one email per report?

from urlwatch.

thp avatar thp commented on July 28, 2024

Because reports are grouped

Trying to rebase before PRing, I discover the existence of new option "separate",

if base_config.get('separate', False):

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 separate, at least for that list of recipients, and then it can get tricky.

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...).

from urlwatch.

monperrus avatar monperrus commented on July 28, 2024

I'm trying to use the separate option.

Neither top-level separate: true.

nor under report works.

report:
  email:
    enabled: true
    separate: true

any suggestion? Thanks!

from urlwatch.

monperrus avatar monperrus commented on July 28, 2024

Have a working version with adding the optional field to to a job:

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)

from urlwatch.

Jamstah avatar Jamstah commented on July 28, 2024

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.

from urlwatch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.