-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support configuration from bucket metadata (fixes #27) #28
Conversation
metadata = storage.get(parent_id=bucket_uri, | ||
collection_id='collection', | ||
object_id=collection_id) | ||
if 'kinto-emailer' not in metadata: |
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.
👍
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.
👍
emails = [r for r in recipients if not GROUP_REGEXP.match(r)] | ||
groups = [r for r in recipients if GROUP_REGEXP.match(r)] | ||
groups = [r.format(**context) for r in recipients |
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.
I think it worth having a comment saying that you might want to build the group name from the collection_id
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.
I added it in the merge commit
@@ -161,7 +170,7 @@ def includeme(config): | |||
|
|||
# Listen to collection modification before commit for validation. | |||
config.add_subscriber(_validate_emailer_settings, ResourceChanged, | |||
for_resources=('collection',), | |||
for_resources=('bucket', 'collection',), | |||
for_actions=('create', 'update')) | |||
|
|||
# Listen to collection and record change events. |
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.
I guess we should probably support groups and buckets events for email notifications.
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.
Created #31
Fixes #27