-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Implemented recipients per basket #442
Conversation
…config to defined by-basket recipients
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #442 +/- ##
==========================================
- Coverage 64.80% 64.67% -0.13%
==========================================
Files 26 26
Lines 2216 2231 +15
==========================================
+ Hits 1436 1443 +7
- Misses 780 788 +8 ☔ View full report in Codecov by Sentry. |
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.
Thank you for your contribution!
This is a good add-on to the current smtp notifier and could be a thing for the other notifiers too.
Please try to stick to the single responsibility principle, which says that every function or method should only have a single responsibility.
The responsibility of the _send_mail method is to send a mail. It shouldn't have to check if everything is set up correctly. This is the responsibility of the init method.
Single recipients are allowed to be string instead of a list with only one item.
Thank You for Your feedback and suggestions! You're right in regards of separation of concerns, that makes it a lot easier to maintain and more secure during runtime. I moved the validation part to the init() method and removed unnecessary parts of the recipient determination. I also updated the config sample to show, that (single) recipients are not limited to Covered syntax cases Fallback to Recipients:
Catched by exception:
Valid formats:
|
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.
In the first review I forgot to mention, that the configuration documentation in wiki/configuration.md should also be modified. The markdown files in wiki/ are uploaded to the github wiki.
Co-authored-by: Henning Merklinger <henning.merklinger@gmail.com>
Co-authored-by: Henning Merklinger <henning.merklinger@gmail.com>
Co-authored-by: Henning Merklinger <henning.merklinger@gmail.com>
Let me know when you are done. Then I will merge. |
Co-authored-by: Henning Merklinger <henning.merklinger@gmail.com>
I finally did some testing again and am ready to merge. |
"RecipientsPerItem" may be used in config to define by-basket recipients. Invalid JSON, item to be notified not found in JSON or not defining RecipientsPerItem falls back to regular Recipient as email address that gets notified.
Pull Request Checklist
Pull Requests for the same update/change?
make test
make lint
make images
make executable
and why you'd like to include them?