reviewboard.notifications.email.hooks¶
Extension hooks for augmenting e-mail messages.
- register_email_hook(signal: Signal, handler: EmailHook) None[source]¶
Register an e-mail hook.
- Parameters:
signal (
django.dispatch.Signal) – The signal that will trigger the e-mail to be sent. This is one ofreview_request_published,review_request_closed,review_published, orreply_published.handler (
reviewboard.extensions.hooks.EmailHook) – TheEmailHookthat will be triggered when an e-mail of the chosen type is about to be sent.
- unregister_email_hook(signal: Signal, handler: EmailHook) None[source]¶
Unregister an e-mail hook.
- Parameters:
signal (
django.dispatch.Signal) – The signal that will trigger the e-mail to be sent. This is one ofreview_request_published,review_request_closed,review_published, orreply_published.handler (
reviewboard.extensions.hooks.EmailHook) – TheEmailHookthat will be triggered when an e-mail of the chosen type is about to be sent.
- filter_email_recipients_from_hooks(to_field: Collection[Union[User, Group]], cc_field: Collection[Union[User, Group]], signal: Signal, **kwargs) Tuple[Collection[Union[User, Group]], Collection[Union[User, Group]]][source]¶
Filter the e-mail recipients through configured e-mail hooks.
- Parameters:
to_field (
set) – The original To field of the e-mail, as a set ofUsersandGroups.cc_field (
set) – The original CC field of the e-mail, as a set ofUsersandGroups.signal (
django.dispatch.Signal) – The signal that triggered the e-mail.**kwargs (
dict) – Extra keyword arguments to pass to the e-mail hook.
- Returns:
A 2-tuple of the To field and the CC field, as sets of
UsersandGroups.- Return type: