Add signal global_email_filter

This commit is contained in:
Raphael Michel
2019-08-30 10:52:12 +02:00
parent 4bae824a03
commit eed217262f
2 changed files with 15 additions and 1 deletions

View File

@@ -514,6 +514,18 @@ If the email is associated with a specific user, e.g. a notification email, the
well, otherwise it will be ``None``.
"""
global_email_filter = django.dispatch.Signal(
providing_args=['message', 'user']
)
"""
This signal allows you to implement a middleware-style filter on all outgoing emails. You are expected to
return a (possibly modified) copy of the message object passed to you.
This signal is called on all events and even if there is no known event. ``sender`` is None.
The ``message`` argument will contain an ``EmailMultiAlternatives`` object.
If the email is associated with a specific user, e.g. a notification email, the ``user`` argument will be passed as
well, otherwise it will be ``None``.
"""
layout_text_variables = EventPluginSignal()
"""