Allow template syntax in event text (Z#23140046) (#3815)

* remove duplicate context generation

* allow text templates in frontpage_text

* refactor: move placeholder functionality to separate file

* fix wrong class name, code style

* update year in license header

* undo license header update

* use new function name

* render only the placeholders that are actually used in the message

* refactoring

* add str(...) call

* Update doc/development/api/placeholder.rst

Co-authored-by: Raphael Michel <michel@rami.io>

* rename register_mail_placeholders to register_template_placeholders
(deprecate old name)

* isort

* add signals to docs

---------

Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
Mira
2024-02-06 11:32:03 +01:00
committed by GitHub
parent 45ac391998
commit bac673f3ab
13 changed files with 654 additions and 582 deletions

View File

@@ -220,14 +220,20 @@ subclass of pretix.base.payment.BasePaymentProvider or a list of these
As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
"""
register_mail_placeholders = EventPluginSignal()
register_text_placeholders = EventPluginSignal()
"""
This signal is sent out to get all known email text placeholders. Receivers should return
an instance of a subclass of pretix.base.email.BaseMailTextPlaceholder or a list of these.
This signal is sent out to get all known text placeholders. Receivers should return
an instance of a subclass of pretix.base.services.placeholders.BaseTextPlaceholder or a
list of these.
As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
"""
register_mail_placeholders = EventPluginSignal()
"""
**DEPRECATED**: This signal has a new name, please use ``register_text_placeholders`` instead.
"""
register_html_mail_renderers = EventPluginSignal()
"""
This signal is sent out to get all known HTML email renderers. Receivers should return a