Adds customizations for discussion notification emails:
external_url: the URL the notification email points to
model_name: the model name used in the notification email
Also allows notifications for Topic.
The expected payload is in Discussion.extras. It will be used for subsequent notifications of comments on discussion and discussion closing. A comment made on a discussion pointing to an external site will always point to this external site, even if made on another frontend.
Both parameters are protected through an access list, to avoid ill-intentioned people injecting links or other arbitrary text in the notification emails:
Both parameters can be omitted, the default behavior will apply. For Topic, since there's no detail page on data.gouv.fr (yet), no notification will be sent if external_url is not supplied.
NB1: there's a grammatical error in the English notification text Your %(type)s have a new discussion, not fixed here because it would involve updating the translations.
NB2: the translation of model_name is not handled. This is not a problem for ecologie.data.gouv.fr and might not be easy to do (how to add a translation for something variable? or include translations in payload?).
Adds customizations for discussion notification emails:
external_url
: the URL the notification email points tomodel_name
: the model name used in the notification emailAlso allows notifications for
Topic
.The expected payload is in
Discussion.extras
. It will be used for subsequent notifications of comments on discussion and discussion closing. A comment made on a discussion pointing to an external site will always point to this external site, even if made on another frontend.Both parameters are protected through an access list, to avoid ill-intentioned people injecting links or other arbitrary text in the notification emails:
DISCUSSION_ALLOWED_EXTERNAL_DOMAINS
(accepts wildcards)DISCUSSION_ALTERNATE_MODEL_NAMES
Both parameters can be omitted, the default behavior will apply. For
Topic
, since there's no detail page on data.gouv.fr (yet), no notification will be sent ifexternal_url
is not supplied.NB1: there's a grammatical error in the English notification text
Your %(type)s have a new discussion
, not fixed here because it would involve updating the translations. NB2: the translation ofmodel_name
is not handled. This is not a problem for ecologie.data.gouv.fr and might not be easy to do (how to add a translation for something variable? or include translations in payload?).Cf https://github.com/ecolabdata/ecospheres/issues/263 for requirements and more details.