diff --git a/app/jobs/scheduled/grant_rookie_badges.rb b/app/jobs/scheduled/grant_rookie_badges.rb index 7913cc0ead..4312bc283a 100644 --- a/app/jobs/scheduled/grant_rookie_badges.rb +++ b/app/jobs/scheduled/grant_rookie_badges.rb @@ -11,7 +11,13 @@ module Jobs scores.each do |user_id, score| # Don't bother awarding to users who haven't received any likes if score > 0.0 - BadgeGranter.grant(badge, User.find(user_id)) + user = User.find(user_id) + if user.badges.where(id: Badge::RookieOfTheMonth).blank? + BadgeGranter.grant(badge, user) + SystemMessage.new(user).create('rookie_of_the_month', { + month_year: Time.now.strftime("%B %Y") + }) + end end end end diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 7d0f5635c3..8203bfa6d6 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -2319,6 +2319,16 @@ en: [Please review and fix them](%{base_url}/admin). + rookie_of_the_month: + title: "You're a Rookie of the Month!" + subject_template: "You're a Rookie of the Month!" + text_body_template: | + Congratulations, you've been awarded the **Rookie of the Month award for %{month_year}**. + + You received this because you've quickly become a valuable member of the community and other members are really enjoying your posts. + + Thanks and keep up the great work! + unsubscribe_link: | To unsubscribe from these emails, [click here](%{unsubscribe_url}).