reviewboard.notifications.email.views¶
Views used to render e-mail previews.
- class BasePreviewEmailView(**kwargs)[source]¶
Bases:
View
Generic view used to preview rendered e-mails.
This is a convenience for class-based views that wraps the
@preview_email
decorator.- build_email = None[source]¶
The function that will build the e-mail.
This must be a class method or, if using an existing top-level function,
staticmethod()
must be used.
- get(*args, **kwargs) HttpResponse [source]¶
Handle a HTTP GET request.
The request will render the e-mail.
- Parameters:
- Returns:
The resulting HTTP response from the handler.
- Return type:
- get_email_data(*args, **kwargs) Union[Dict[str, Any], HttpResponse] [source]¶
Return data used for the e-mail builder.
The data returned will be passed to
build_email
to handle rendering the e-mail.This can also return a
HttpResponse
, which is useful for returning errors.- Parameters:
- Returns:
The dictionary data to pass as keyword arguments to
build_email
, or an instance ofHttpResponse
to immediately return to the client.- Return type:
- __annotations__ = {}¶