Where to find the code that generates emails of newly created bugs?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Where to find the code that generates emails of newly created bugs?

FrankSCH
Hi all,
we have the need to blank out some of the fields in the emails of
newly created bugs if it goes to a certain group of users. I managed
to customize Bugzilla for emails of changed bugs (same purpose:
recipients belong to that group) by modifying the BugMail.pm, but I do
not find the spot where the bug-creation-emails are generated.

Is there anyone who can give a hint?
-Thanks in advance!!
Kind regards,
Frank
_______________________________________________
support-bugzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put [hidden email] in the To: field when you reply.
Reply | Threaded
Open this post in threaded view
|

RE: Where to find the code that generates emails of newly created bugs?

Tosh, Michael J
Frank wrote:
> Hi all,
> we have the need to blank out some of the fields in the emails of
> newly created bugs if it goes to a certain group of users. I managed
> to customize Bugzilla for emails of changed bugs (same purpose:
> recipients belong to that group) by modifying the BugMail.pm, but I do
> not find the spot where the bug-creation-emails are generated.

There are templates for the email, but the diffs are generated right in BugMail.pm based on what is in the bugs_activity table.  See this code:
http://bzr.mozilla.org/bugzilla/4.0/annotate/head:/Bugzilla/BugMail.pm#L158

It grabs all changes since the 'lastdiffed' time, and formats them into the @diffparts array.  Just note that the code is duplicated down on line 229 in this file for checking the dependencies.  So if you change one, you should change the other or you risk data getting out.
_______________________________________________
support-bugzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put [hidden email] in the To: field when you reply.
Reply | Threaded
Open this post in threaded view
|

Re: Where to find the code that generates emails of newly created bugs?

FrankSCH
In reply to this post by FrankSCH
On 19 Apr., 15:58, "Tosh, Michael J" <[hidden email]> wrote:
> There are templates for the email, but the diffs are generated right in BugMail.pm based on what is in the bugs_activity table.  See this code:http://bzr.mozilla.org/bugzilla/4.0/annotate/head:/Bugzilla/BugMail.p...
>
> It grabs all changes since the 'lastdiffed' time, and formats them into the @diffparts array.  Just note that the code is duplicated down on line 229 in this file for checking the dependencies.  So if you change one, you should change the other or you risk data getting out.

Hi Michael,
thanks for your reply!

I played around with the email template (in /template/en/default/
email), but only got malformed emails when I tried to hide certain
fields with a TT statement like "[% IF
user.in_group('my_control_group') %]" around the field tokens (X-
Bugzilla-xxxx). So, I modified the BugMail.pm. Unfortunately I only
managed to manupulate the email generation if a bug is changed.

Is the @diffparts array used for both bug creation and bug change
emails? - I think I have to have deeper look on this...

Btw. I am refering to Bugzilla 3.6.3, but in general it should be the
same in 3.6.4, or 4.0...

Kind regards,
Frank
_______________________________________________
support-bugzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put [hidden email] in the To: field when you reply.