class
BaseMailTextPlaceholder
pretalx.mail.domain.placeholders.BaseMailTextPlaceholder source
Base class for all email text placeholders.
Attributes 1
account_requiredFalseProperties 4
Defined here
explanationsource
@property
def explanation(self):
return ""
identifiersourceUnique key the placeholder is referenced by in templates.
@property
def identifier(self):
"""Unique key the placeholder is referenced by in templates."""
raise NotImplementedError
is_visiblesourceSet False to hide from the placeholder picker (e.g.
aliases).
@property
def is_visible(self):
"""Set ``False`` to hide from the placeholder picker (e.g. aliases)."""
return True
required_contextsourceKeys this placeholder needs in the render context.
@property
def required_context(self):
"""Keys this placeholder needs in the render context."""
return ["event"]
Methods 3
Defined here
render(context)sourceReturn the rendered value given a context dict.
def render(self, context):
"""Return the rendered value given a context dict."""
raise NotImplementedError
render_sample(event)sourceReturn a preview value that depends only on event.
def render_sample(self, event):
"""Return a preview value that depends only on ``event``."""
raise NotImplementedError
render_sample_for_preview(event)sourceShape the sample like render's output so the preview pipeline matches delivery.
def render_sample_for_preview(self, event):
"""Shape the sample like :meth:`render`'s output so the preview
pipeline matches delivery."""
return self.render_sample(event)