Skip to content

Commit

Permalink
Show which domains were used in the spam_post_blocked notification
Browse files Browse the repository at this point in the history
  • Loading branch information
nlalonde committed Sep 12, 2013
1 parent 90aaa27 commit 8276807
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/locales/server.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,8 @@ en:
text_body_template: |
This is an automated message to inform you that the new user [%{username}](%{user_url}) tried to create multiple posts with links to the same domain, but they were blocked based on the newuser_spam_host_threshold site setting.
Domain(s) included in %{username}'s posts: %{domains}
Please [review the user](%{user_url}).
unblocked:
Expand Down
6 changes: 5 additions & 1 deletion lib/post_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ def create
end

if @spam
GroupMessage.create( Group[:moderators].name, :spam_post_blocked, {user: @user, limit_once_per: 24.hours} )
GroupMessage.create( Group[:moderators].name,
:spam_post_blocked,
{ user: @user,
limit_once_per: 24.hours,
message_params: {domains: @post.linked_hosts.keys.join(', ')} } )
end

enqueue_jobs
Expand Down

0 comments on commit 8276807

Please sign in to comment.