Jump to >

reviewboard.notifications.email.views

Views used to render e-mail previews.

class BasePreviewEmailView(**kwargs)[source]

Bases: django.views.generic.base.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)[source]

Handle a HTTP GET request.

The request will render the e-mail.

Parameters:
  • *args (tuple) – Positional arguments passed to the handler.
  • **kwargs (dict) – Keyword arguments passed to the handler.
Returns:

The resulting HTTP response from the handler.

Return type:

django.http.HttpResponse

get_email_data(*args, **kwargs)[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:
  • *args (tuple) – Positional arguments passed to the handler.
  • **kwargs (dict) – Keyword arguments passed to the handler.
Returns:

The dictionary data to pass as keyword arguments to build_email, or an instance of HttpResponse to immediately return to the client.

Return type:

object