Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
d93f2e56
Commit
d93f2e56
authored
Feb 11, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 545683: New Hook: bugmail_recipients
r=mkanat, a=mkanat (module owner)
parent
0c0be3db
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
0 deletions
+50
-0
BugMail.pm
Bugzilla/BugMail.pm
+4
-0
Hook.pm
Bugzilla/Hook.pm
+38
-0
Extension.pm
extensions/Example/Extension.pm
+8
-0
No files found.
Bugzilla/BugMail.pm
View file @
d93f2e56
...
...
@@ -42,6 +42,7 @@ use Bugzilla::Product;
use
Bugzilla::
Component
;
use
Bugzilla::
Status
;
use
Bugzilla::
Mailer
;
use
Bugzilla::
Hook
;
use
Date::
Parse
;
use
Date::
Format
;
...
...
@@ -426,6 +427,9 @@ sub Send {
}
}
Bugzilla::Hook::
process
(
'bugmail_recipients'
,
{
recipients
=>
\%
recipients
});
# Find all those user-watching anyone on the current list, who is not
# on it already themselves.
my
$involved
=
join
(
","
,
keys
%
recipients
);
...
...
Bugzilla/Hook.pm
View file @
d93f2e56
...
...
@@ -356,6 +356,44 @@ The definition is structured as:
=back
=head2 bugmail_recipients
This allows you to modify the list of users who are going to be receiving
a particular bugmail. It also allows you to specify why they are receiving
the bugmail.
Users' bugmail preferences will be applied to any users that you add
to the list. (So, for example, if you add somebody as though they were
a CC on the bug, and their preferences state that they don't get email
when they are a CC, they won't get email.)
This hook is called before watchers or globalwatchers are added to the
recipient list.
Params:
=over
=item C<recipients>
This is a hashref. The keys are numeric user ids from the C<profiles>
table in the database, for each user who should be receiving this bugmail.
The values are hashrefs. The keys in I<these> hashrefs correspond to
the "relationship" that the user has to the bug they're being emailed
about, and the value should always be C<1>. The "relationships"
are described by the various C<REL_> constants in L<Bugzilla::Constants>.
Here's an example of adding userid C<123> to the recipient list
as though he were on the CC list:
$recipients->{123}->{+REL_CC} = 1
(We use C<+> in front of C<REL_CC> so that Perl interprets it as a constant
instead of as a string.)
=back
=head2 colchange_columns
This happens in F<colchange.cgi> right after the list of possible display
...
...
extensions/Example/Extension.pm
View file @
d93f2e56
...
...
@@ -189,6 +189,14 @@ sub buglist_columns {
$columns
->
{
'example'
}
=
{
'name'
=>
'bugs.delta_ts'
,
'title'
=>
'Example'
};
}
sub
bugmail_recipients
{
my
(
$self
,
$args
)
=
@_
;
my
$recipients
=
$args
->
{
'recipients'
};
# Uncomment the below line to add the first user in the Bugzilla database
# to every bugmail as though he/she were a CC.
#$recipients->{1}->{+REL_CC} = 1;
}
sub
colchange_columns
{
my
(
$self
,
$args
)
=
@_
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment