diff --git a/src/kinto_emailer/__init__.py b/src/kinto_emailer/__init__.py index 38d551d..4d94406 100644 --- a/src/kinto_emailer/__init__.py +++ b/src/kinto_emailer/__init__.py @@ -86,7 +86,7 @@ def _get_emailer_hooks(storage, context): collection_id = context["collection_id"] bucket_uri = "/buckets/%s" % bucket_id # Look-up collection metadata. - # If the event on the collection, do not rely storage, use the event payload. + # If the event is on the collection, do not rely on storage, use the event payload. if context["resource_name"] == "collection": metadata = next( impacted["old"] if context["action"] == "delete" else impacted["new"] @@ -147,7 +147,7 @@ def get_messages(storage, context): if not conditions_met: continue - msg = hook["template"].format(**context) + msg = hook["template"].format(**context) or "(no body)" subject = hook.get("subject", "New message").format(**context) recipients = _expand_recipients(storage, hook["recipients"], context)