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
HttpRequestand the keyword arguments generated from the URL. It should return adictof keyword arguments to be passed to theemail_builderfunction.However, if the decorated function returns a
HttpRequestthat response will be returned instead.The returned view will always return a HTTP 404 Not Found when
DEBUGisFalse(i.e., the view only works when Review Board is running as a development server.Parameters: email_builder (callable) – A function that generates an
EmailMessagefrom 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