Jump to >

ReviewRequestPublishedEmailHook

reviewboard.extensions.hooks.ReviewRequestPublishedEmailHook allows extensions to modify the recipients of e-mails generated from review publishing actvity

ReviewRequestPublishedEmailHook requires one arguments for initialization: the extension instance.

ReviewRequestPublishedEmailHook should be sub-classed to provide the desired behaviour. The default behaviour of the get_to_field() and get_cc_field() methods is to return the field unmodified.

Example

from reviewboard.extensions.base import Extension
from reviewboard.extensions.hooks import ReviewRequestPublishedEmailHook

class SampleEmailHook(ReviewRequestPublishedEmailHook):
    def get_to_field(self, to_field, review_request, user):
        to_field.add(user)

    def get_cc_field(self, cc_field, review_request, user):
        return set([])

class SampleExtension(Extension):
    def initialize(self):
        SampleEmailHook(self)