Problem/Motivation

When posting a comment on an issue you get notified of your update via email. Some people don't need to be notified of updates that they are making themselves.

Proposed resolution

Add a new notifications option for including your own updates, default it to TRUE, and then expose this option in the UI on the main notifications interface in the user account area.

Remaining tasks

Review the proposed implementation and patch.

User interface changes

A new checkbox will be added to the notifications section, see #6 for a screenshot of this.

API changes

There will be a new 'include_own_updates' user specific option, but this isn't really an API.

Original report by optidel

I am using this module in our intranet and it seems to be a big hit with everyone. The one peeve is that if someone subscribes to the issue tracker, they get an email for their own updates too. Not a show stopper but not very intuitive too. Sometimes the users go on an issue clearing spree and they end up updating a lot of issues in one go and they also end up getting a lot emails because of that.

Comments

dww’s picture

I'm tempted to won't fix this. I often find it's useful to get my own emails on other sites where I'm using this module, for example, to forward the update to someone who's not necessarily on the site using the issue queue. In terms of the situation you describe where someone's on a spree updating issues -- if you're spamming everyone subscribed to the queue, you might as well be getting a dose of your own medicine. ;)

That said, this *could* be an option that users could control for themselves as part of the issue subscription overhaul that desperately needs to happen...

alberto56’s picture

Title: Do not email the person who is making the update » Manage e-mail notifications: Add option to not email the person who is making the update

@dww perhaps just adding the option to not email the owner would be nice.

If I go, say, to http://drupal.org/project/issues/subscribe-mail/dynamic_persistent_menu, I'm given the option of being notified of all issues, issues I follow, or none. It would make sense to add a checkbox here saying: "Don't notify of own posts/comments", so that next time I create a post or comment, I don't get notified.

Cheers,

Albert.

danepowell’s picture

I would also like to see this- it's kind of annoying to get an email for an update to an issue, post a reply, delete the email, and then a few moments later get ANOTHER email with the reply that I just posted.

steven jones’s picture

Status: Active » Needs review
StatusFileSize
new6.75 KB

Here's a very rough, first cut of this. Completely untested, but just want to get something out there.

steven jones’s picture

StatusFileSize
new6.76 KB

Here's a slightly tweaked version that flips the checkbox around, so that you tick the box to not receive your own updates, which I think makes more sense, and copies what other systems (Redmine) do.

I've tested this on a simple project issue setup locally, and it seems to work fine!

steven jones’s picture

StatusFileSize
new38.66 KB

Here's a screenshot of what the added checkbox looks like:

My account-project-not-me.png

steven jones’s picture

StatusFileSize
new38.21 KB

Actually the patch in #5 contravenes the User interface standards so the patch in comment #4 should be reviewed and preferred.

Here's an updated screenshot:

My account-project-not-me-1.png

chriscohen’s picture

+1 for this. I get a lot of email anyway, and if I post on an issue, I tend to know I've posted, since I am not senile (yet), so I'd like to opt not to get an email confirming that I've done something I know I've just done!

attiks’s picture

Status: Needs review » Needs work

Review of patch in #4

+++ b/project_issue.installundefined
@@ -300,6 +300,14 @@ function project_issue_schema() {
+        'description' => 'User preference for whether they want to be receive notifications of their own updates.',

@@ -1181,3 +1189,22 @@ function project_issue_update_6018() {
+    'description' => 'User preference for whether they want to be receive notifications of their own updates.',

... want to receive ...

steven jones’s picture

Status: Needs work » Needs review
StatusFileSize
new6.74 KB

Manual edit of the patch that corrects the issue described in #9

attiks’s picture

Status: Needs review » Reviewed & tested by the community

Is looking good, but I have to admit I didn't try patching

steven jones’s picture

Status: Reviewed & tested by the community » Needs review

Sorry, but this really does need a proper review I think.

attiks’s picture

Status: Needs review » Reviewed & tested by the community

I installed everything and created a new project + issues and the notification are only sent to myself when the checkbox is checked.

RTBC for real this time

steven jones’s picture

Thanks for the review.

This still needs this question from the issue summary answering:

check that this can be ported to D7 easily.

I don't really know enough about the D7 port to say one way or the other.

steven jones’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev
Status: Reviewed & tested by the community » Needs work

From d.o office hours IRC:

<@darthsteven> I'm interested in finding out what it would take to get an issue I've fixed deployed onto d.o: http://drupal.org/node/667122
<@Druplicon> http://drupal.org/node/667122 => Manage e-mail notifications: Add option to not email the person who is making the update => Project issue tracking, Mail, normal, reviewed & tested by the community, 14 comments, 1 IRC mention
<@darthsteven> Specifically do I need to port my fix to D7 too
<@drumm> darthsteven: yes, for project we've been working on only the D7 upgrade for the last few months. We do need a 7.x version.
<@drumm> darthsteven: thanks for the patch so far!
<@darthsteven> drumm: thanks, I'll work out how to port it and post a patch

so we'll port and fix in D7.

kingandy’s picture

If this gets ported to D7 and then backported to D6, I will laugh...

kingandy’s picture

Issue summary: View changes

Add issue summary

steven jones’s picture

Totally going to work on this at Drupalcon.

steven jones’s picture

StatusFileSize
new9.15 KB

Here's a cheeky little re-roll for D7.

This still needs some tests.

steven jones’s picture

StatusFileSize
new9.13 KB

Actually, we should use the ->uid properties for the actor, not use globals.

steven jones’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new13.83 KB

Right, actually, I can remove the 'actor' stuff from the previous patch, and I can add some tests!

dww’s picture

Thanks! Very brief review looks good. I just downloaded the patch to my laptop and will do a more thorough review and testing ASAP.

Cheers,
-Derek

  • Commit 4374447 on 7.x-2.x by dww:
    [#667122] by dww: Follow-up cleanup from commit 661e6f31:
    
    - Renamed the...
  • Commit 661e6f3 on 7.x-2.x authored by Steven Jones, committed by dww:
    [#667122] by Steven Jones: Added setting for users to opt-out of...
dww’s picture

Status: Needs review » Fixed
Issue tags: +needs drupal.org deployment

Had a lot of time on a plane so I gave this a thorough review and local testing. It works great, thanks! And yay for including tests with your patch. :)

I committed your patch exactly as-is to commit 661e6f318. Then, I made some cleanups. Mostly pedantic nit-picky stuff that I didn't want to have you re-roll for. Committed that as commit 437444744. Notes on what I changed:

A) I renamed the DB column and internal variables to 'notify_own_updates' instead of 'include_own_updates'. Using 'include' sort of implies the setting controls what's included in the notification (e.g. another setting affecting the content of the messages) not if I should get notified at all. The UI text for the setting (which I like) uses 'notified', so we should use the same verb for the internal stuff that references it, too.

B) I didn't like how the patch overloaded $can_access inside _project_issue_email_notify(). Seems cleaner to use continue; once we realize we don't want to send the message. Frankly, I should just kill $can_access and use continue; there, too. Just pushed that as commitd d3f7e7adee, in fact. ;)

C) Fixed a handful of wonky code comments.

D) I wasn't thrilled with ProjectIssueWebTestCase::createIssueComment(). It was basically cut+paste from CommentHelperCase::postComment(), and was needlessly re-testing comment.module's settings and behaviors (generating more assertions than we need, slowing things down, etc). IMHO, project_issue shouldn't be in the business of testing if requiring comment previews is working or not. ;) It now variable_set()'s to set preview to optional, has a lot less assertions, doesn't mess with all the $contact stuff we don't care about, etc.

Tested again (just to be sure I didn't break anything) and pushed both commits.

Now this just needs to be deployed. ;)

Thanks so much, and sorry it took so long to get this reviewed and in!

Cheers,
-Derek

steven jones’s picture

AMAZING!

Thank you so much, and completely agree with the cleanups that you've made.
I'll try to tone down my 'conversational' style comments in tests next time :)

drumm’s picture

Issue tags: -needs drupal.org deployment

Now deployed to Drupal.org.

steven jones’s picture

Thanks very much!

(I'm looking forward to not getting this email)

attiks’s picture

Thanks all, this is great

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.