change mail notifications for existing and future users

Added by Chris Tunnell over 9 years ago

TWo questions:

How do I change the mail notification settings of existing users (I want everybody to be switched to "only issues assigned to me or that I watch")?

How do I make the default (for new users) to be only assigned assigned to them?

I'm having an issue with people complaining about the defaults and hating the system (which I'm starting to use for a group of 100 people)

Thanks for any help!!

Replies (15)

RE: change mail notifications for existing and future users - Added by Felix Schäfer over 9 years ago

I think both are the defaults. What version of redmine are you using?

RE: change mail notifications for existing and future users - Added by Chris Tunnell over 9 years ago

1.0.0.stable. And it's definitely not the case, sadly.

I heard you could do stuff with the 'console', which doesn't load for me.

[garfield@heplnm068 redmine]$ !470
RAILS_ENV=production script/console
Loading production environment (Rails 2.3.5)
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError)
from /usr/local/lib/ruby/1.8/irb/completion.rb:10
from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `require'
from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `each'
from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'
from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'
from /usr/local/bin/irb:13

RE: change mail notifications for existing and future users - Added by Felix Schäfer over 9 years ago

Well, the default for new users is "only for things I watch or I'm involved in", and it has been for a long time, so if your users experience something else, they have changed it themselves. There is some work being done on that on trunk currently, but that doesn't affect the stable branch. Do you have any plugins installed?

RE: change mail notifications for existing and future users - Added by Chris Tunnell over 9 years ago

No I don't have any plugins installed. Assuming something crazy is happening (or I did something stupid) what command should I run to force everybody to 'only things I watch or am involved in"?

Also, how do I check the default?

RE: change mail notifications for existing and future users - Added by Chris Tunnell over 9 years ago

And thanks for the help. I enjoy the application very much, but solving this will really help the acceptance.

RE: change mail notifications for existing and future users - Added by Chris Tunnell over 9 years ago

Oh, I have:

Redmine Newissuealerts plugin

installed which sends an email to some address (mailing list in my case) whenever an issue is posted. Should I remove/edit the plugin then?

RE: change mail notifications for existing and future users - Added by Chris Tunnell over 9 years ago

But it doesn't appear to have anything in it that changes the variable "mail_notification".

RE: change mail notifications for existing and future users - Added by Felix Schäfer over 9 years ago

No it doesn't, IIRC the plugin just sends a mail on each new issue to the addresses specified in its configuration, regardless of any mail notification settings as it is not bound to a particular user. Try turning it off and see if your users get "spammed" less.

RE: change mail notifications for existing and future users - Added by Chris Tunnell over 9 years ago

Okay: let me rephrase. I've created accounts. They have "mail on all things I'm involved in" set.

Can I change this for all users with one command at the command line?

RE: change mail notifications for existing and future users - Added by Felix Schäfer over 9 years ago

Well, you can start by inspecting those that don't have it set (all this in RAILS_ENV=production script/console, the problem you had up there seems to come from either ruby not being compiled with readline or ruby not finding the readline libs at execution time):

User.find_all_by_mail_notification(true)

This should (I don't have an older DB to test it on, sorry) return an array with all users that have set their mail notification to either "everything for those projects" or "everything for my projects".

Setting everyone back to "mail on all things I'm involved in" should work with the following:

User.update_all("mail_notification = 0")

(adapt the 0 to whatever your DB understands as false on the boolean column type)

Oh, and I haven't tested it and give no guarantee for it, you should have a backup, and so on.

RE: change mail notifications for existing and future users - Added by Anonymous over 9 years ago

Is there also a command line to set "I don't want to be notified of changes that I make myself" to checked for all? Or asked in another way: can that be set as the default setting when new users are added?

RE: change mail notifications for existing and future users - Added by Felix Schäfer over 9 years ago

For the default, look for:

<p><label><%= l(:label_user_mail_no_self_notified) %></label><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified] %></p>

and change 1 to 0 (the line should be either in app/views/my/account.rhtml or app/views/users/_mail_notifications.html.erb).

RE: change mail notifications for existing and future users - Added by Miguel Rojas over 8 years ago

Hi everybody... I'm having a similar issue.

We're currently using redmine 1.0.0 stable w/MySQL and we can't change the form option for the email notifications to "Only things I watch...". The form send the data, but the option remains unchanged (currently is set on all notifications).

Is there a bug or something? I would appreciate any help

RE: change mail notifications for existing and future users - Added by Truong Ta over 4 years ago

On Redmine 3.1.1, with LDAP users, I modified the file app/models/user.rb, line 222:

...
        user.language = Setting.default_language
        user.pref.no_self_notified = '1'
        if user.save
...

(1-15/15)