mantisbt/mantisbt — pull request #48 by afortaleza (2012-05-28 02:36:14+00:00)
Title: Recipient collection using associative array

In the original code, the email recipient collection under the email_collect_recipients() method accepted, as a callback return under the EVENT_NOTIFY_USER_INCLUDE event, an array of user IDs. I've expanded this and the callback function can also return an associative array with the keys user_id and email.

I've done this because I've deleoped a plugin that is able to add email addresses as monitors for bugs. The plugin uses a user created by itself on installation to send the emails. It was not possible, under the old code, to associate different emails for the same user, but now, using this new return type for the callback function, it is possible.

I had to change the email_bug_info_to_one_user() method signature to make this work the right way, I don't know if this is acceptable, but if it is, I'd like to have this code pulled in so I can make my plugin public. The old behavior still works the same way, the only major change was the signature of the email_bug_info_to_one_user() method. In all of the MantisBT itself, this method is used only once, but it's a public method, maybe it would be more wise to write a new proxy method?