diff --git a/app/models/concerns/roleable.rb b/app/models/concerns/roleable.rb index 86598092264..07062692400 100644 --- a/app/models/concerns/roleable.rb +++ b/app/models/concerns/roleable.rb @@ -20,6 +20,7 @@ module Roleable def grant_moderation! set_permission('moderator', true) + enqueue_welcome_moderator_message end def revoke_moderation! diff --git a/app/models/user.rb b/app/models/user.rb index 2a8a55f595e..9b27e1665bf 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -415,6 +415,11 @@ class User < ActiveRecord::Base Jobs.enqueue(:send_system_message, user_id: id, message_type: "welcome_tl1_user") end + def enqueue_welcome_moderator_message + return unless moderator + Jobs.enqueue(:send_system_message, user_id: id, message_type: 'welcome_moderator') + end + def change_username(new_username, actor = nil) UsernameChanger.change(self, new_username, actor) end diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 9f3dd9b53b3..2209536a1ba 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -2659,6 +2659,13 @@ en: We’re really glad you’re spending time with us and we’d love to know more about you. Take a moment to [fill out your profile](%{base_url}/my/preferences/profile), or feel free to [start a new topic](%{base_url}/categories). + welcome_moderator: + title: "Welcome Moderator" + subject_template: "Congratulations on becoming a moderator!" + text_body_template: | + You are now a moderator. -- congratulations! + + You now have access to the admin interface welcome_invite: title: "Welcome Invite" subject_template: "Welcome to %{site_name}!"