mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 03:10:46 -06:00
Send the user a notice when they've received rookie of the month
This commit is contained in:
parent
893e93dfbe
commit
e6f6bd34d8
@ -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
|
||||
|
@ -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}).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user