Skip to content

Commit

Permalink
Some doc
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Jan 26, 2017
1 parent c761e80 commit deedf31
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ This document describes changes between each past release.
0.2.0 (unreleased)
------------------

- Nothing changed yet.
**New features**

- List of recipients can now contain groups URIs. The principals from the specified
group that look like email addresses will be used as recipients.


0.1.0 (2017-01-25)
Expand Down
14 changes: 13 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ Optional:
* ``sender`` (e.g.``"Kinto team <developers@kinto-storage.org>"``)
Recipients
----------
The list of recipients can either contain:
* Email adresses (eg. ``alice@wonderland.com`` or ``"Joe Doe <jon@doe.com>"``)
* Group URI (eg. ``/buckets/staging/groups/reviewers``)

With group URIs, the email recipients will be expanded with the group members
principals look like email addresses (eg. ``ldap:peace@world.org``).


Selection
---------

Expand All @@ -103,7 +115,7 @@ It is possible to define several *hooks*, and filter on some condition. For exam
"resource_name": "collection",
"action": "updated",
"template": "Collection updated!",
"recipients": ['Security reviewers <security-reviews@mozilla.com>']
"recipients": ["Security reviewers <security-reviews@mozilla.com>"]
}]
}
}
Expand Down
2 changes: 1 addition & 1 deletion kinto_emailer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _get_collection_record(storage, bucket_id, collection_id):


def _expand_recipients(storage, recipients):
emails = [r for r in recipients if EMAIL_REGEXP.match(r)]
emails = [r for r in recipients if not GROUP_REGEXP.match(r)]
groups = [r for r in recipients if GROUP_REGEXP.match(r)]
for group_uri in groups:
bucket_uri, group_id = group_uri.split('/groups/')
Expand Down

0 comments on commit deedf31

Please sign in to comment.