From 827680766ebbccbffd7786f3476e85f4f5d8b736 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 12 Sep 2013 17:33:30 -0400 Subject: [PATCH] Show which domains were used in the spam_post_blocked notification --- config/locales/server.en.yml | 2 ++ lib/post_creator.rb | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 937b3d09151..4acbf786c87 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -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: diff --git a/lib/post_creator.rb b/lib/post_creator.rb index a80f72d948e..e22cf591120 100644 --- a/lib/post_creator.rb +++ b/lib/post_creator.rb @@ -75,7 +75,11 @@ class PostCreator 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