Jump to >

reviewboard.notifications.email.decorators

E-mail message-related decorators.

preview_email(email_builder)[source]

Create a view to preview an e-mail message.

The decorated function should accept the arguments a view would expect, i.e. an HttpRequest and the keyword arguments generated from the URL. It should return a dict of keyword arguments to be passed to the email_builder function.

However, if the decorated function returns a HttpRequest that response will be returned instead.

The returned view will always return a HTTP 404 Not Found when DEBUG is False (i.e., the view only works when Review Board is running as a development server.

Parameters:email_builder (callable) –

A function that generates an EmailMessage from the keyword arguments passed into it.

This function may also return None, in which case a 404 Not Found will be returned.

Returns:A view that will generate a preview of the e-mail generated by the specified function.
Return type:callable