Feature #8673
closedDisabling user creation emails.
90%
Description
Hello.
Background¶
We have setup redmine for internal usage at my company, we are very happy with redmine but wanted to make a small change. We wanted to start getting support mails from our customers into redmine without letting them actually login into redmine, but still get notifications when their issue is updated. All this worked "out of the box", but when a new users wants to submit an issue they get an account activation email, we wanted to disable this mail since they will not be able to login anyways.
Fix¶
I added a parameter called send_user_creation_mail to mail_handler.rb and documented it in email.rake
Source¶
escstorm:/tmp# diff /var/www/redmine-1.2.0/app/models/mail_handler.rb redmine-1.2.0/app/models/mail_handler.rb 40d39 < @@handler_options[:send_user_creation_mail] = (@@handler_options[:send_user_creation_mail].to_s == '1' ? true : false) 68,72c67 < if @@handler_options[:send_user_creation_mail] == false < logger.info "MailHandler: Not sending mail to new user, as requested by option" if logger && logger.info < else < Mailer.deliver_account_information(@user, @user.password) < end --- > Mailer.deliver_account_information(@user, @user.password)
escstorm:/tmp# diff /var/www/redmine-1.2.0/lib/tasks/email.rake redmine-1.2.0/lib/tasks/email.rake 76,78c76 < < send_user_creation_mail=0 this option can be used to disable sending account < creation mails to users in combination with unknown_user=create --- > 134d131 < options[:send_user_creation_mail] = ENV['send_user_creation_mail'] if ENV['send_user_creation_mail']
It is not a big fix but I hope you will consider merging it with the main code so I don't have to keep track of this change everytime I upgrade our redmine installation. I am a professional Java-developer but this is my first ruby change ever. I have tested it and it works good for our need and I tried to write the if-statment in a way so that it will hopefully work for everyone else too. I made the change in 1.2.0 stable source
Regards Mihaly
Related issues
Updated by Go MAEDA about 10 years ago
- Status changed from New to Closed
- Resolution set to Duplicate
rdm-mailhander.rb now supports --no-account-notice
option and you can disable account notification to the newly created user.
Please see #11498 for details.
Updated by Go MAEDA about 10 years ago
- Related to Feature #11498: Add --no-account-notice option for the mail handler script added