Merge branch 'user-account-created-email' into 'master'

Only send "Account was created for you" email when created by admin.

See #1985

cc @sytse

See merge request !1517
This commit is contained in:
Dmitriy Zaporozhets 2015-02-16 03:08:48 +00:00
commit ec5622b1a4

View file

@ -559,7 +559,7 @@ class User < ActiveRecord::Base
def post_create_hook def post_create_hook
log_info("User \"#{self.name}\" (#{self.email}) was created") log_info("User \"#{self.name}\" (#{self.email}) was created")
notification_service.new_user(self, @reset_token) notification_service.new_user(self, @reset_token) if self.created_by_id
system_hook_service.execute_hooks_for(self, :create) system_hook_service.execute_hooks_for(self, :create)
end end