Add E-Mail Extension Hooks

Review Request #7563 — Created July 31, 2015 and submitted

Information

Review Board
release-2.0.x

Reviewers

E-mail extension hooks allow extensions to modify the recipients of
e-mails sent for the following events:

  • review request published;
  • review request closed;
  • review published; and
  • review reply published;

There is a specific hook for each e-mail event and a generic
EmailHook which can trigger for any of the above events.

Unit tests have been added to ensure that the hooks behave as
expected.

Documentation has been added to the manual that covers all the new
hooks.

Ran unit test.

Built the docs and viewed them.

Description From Last Updated

Col: 1 E302 expected 2 blank lines, found 1

reviewbotreviewbot

Col: 26 E124 closing bracket does not match visual indentation

reviewbotreviewbot

Col: 64 E202 whitespace before ')'

reviewbotreviewbot

Col: 9 W503 line break before binary operator

reviewbotreviewbot

This seems like something that would be great to put in djblets siteconfig module.

daviddavid

Can we include the word "extension" or "hook" in this function name somehow?

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/notifications/email.py
        reviewboard/extensions/hooks.py
        reviewboard/extensions/tests.py
    
    Ignored Files:
        docs/manual/extending/extensions/hooks/review_request_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_request_closed_email_hook.rst
        docs/manual/extending/extensions/hooks/email-hook.rst
        docs/manual/extending/extensions/hooks/index.rst
        docs/manual/extending/extensions/hooks/review_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_reply_published_email_hook.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/notifications/email.py
        reviewboard/extensions/hooks.py
        reviewboard/extensions/tests.py
    
    Ignored Files:
        docs/manual/extending/extensions/hooks/review_request_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_request_closed_email_hook.rst
        docs/manual/extending/extensions/hooks/email-hook.rst
        docs/manual/extending/extensions/hooks/index.rst
        docs/manual/extending/extensions/hooks/review_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_reply_published_email_hook.rst
    
    
  2. reviewboard/extensions/tests.py (Diff revision 1)
     
     
    Show all issues
    Col: 1
     E302 expected 2 blank lines, found 1
    
  3. reviewboard/extensions/tests.py (Diff revision 1)
     
     
    Show all issues
    Col: 26
     E124 closing bracket does not match visual indentation
    
  4. reviewboard/extensions/tests.py (Diff revision 1)
     
     
    Show all issues
    Col: 64
     E202 whitespace before ')'
    
  5. reviewboard/notifications/email.py (Diff revision 1)
     
     
    Show all issues
    Col: 9
     W503 line break before binary operator
    
  6. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/notifications/email.py
        reviewboard/extensions/hooks.py
        reviewboard/extensions/tests.py
    
    Ignored Files:
        docs/manual/extending/extensions/hooks/review_request_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_request_closed_email_hook.rst
        docs/manual/extending/extensions/hooks/email-hook.rst
        docs/manual/extending/extensions/hooks/index.rst
        docs/manual/extending/extensions/hooks/review_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_reply_published_email_hook.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/notifications/email.py
        reviewboard/extensions/hooks.py
        reviewboard/extensions/tests.py
    
    Ignored Files:
        docs/manual/extending/extensions/hooks/review_request_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_request_closed_email_hook.rst
        docs/manual/extending/extensions/hooks/email-hook.rst
        docs/manual/extending/extensions/hooks/index.rst
        docs/manual/extending/extensions/hooks/review_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_reply_published_email_hook.rst
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/extensions/tests.py (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    This seems like something that would be great to put in djblets siteconfig module.

    1. load_site_config is a ReviewBoard thing, not djblets.

  3. reviewboard/notifications/email.py (Diff revision 2)
     
     
    Show all issues

    Can we include the word "extension" or "hook" in this function name somehow?

  4. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/notifications/email.py
        reviewboard/extensions/hooks.py
        reviewboard/extensions/tests.py
    
    Ignored Files:
        docs/manual/extending/extensions/hooks/review_request_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_request_closed_email_hook.rst
        docs/manual/extending/extensions/hooks/email-hook.rst
        docs/manual/extending/extensions/hooks/index.rst
        docs/manual/extending/extensions/hooks/review_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_reply_published_email_hook.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/notifications/email.py
        reviewboard/extensions/hooks.py
        reviewboard/extensions/tests.py
    
    Ignored Files:
        docs/manual/extending/extensions/hooks/review_request_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_request_closed_email_hook.rst
        docs/manual/extending/extensions/hooks/email-hook.rst
        docs/manual/extending/extensions/hooks/index.rst
        docs/manual/extending/extensions/hooks/review_published_email_hook.rst
        docs/manual/extending/extensions/hooks/review_reply_published_email_hook.rst
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (71eec06)