Project

General

Profile

Actions

Defect #25049

open

Issues which are assigned to group are not listed in reminders if 'users' parameter is specified

Added by Go MAEDA over 7 years ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Email notifications
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Assume the following situation:

  • John (id: 2) and Dave (id: 3) belong to a group.
  • The group is an assignee of an issue which subject is "Assigned to group".

If you run "rake redmine:send_reminders users=2", the issue "Assigned to group" should be listed in the reminder which John receives. But in fact it is not.

This is a test code to catch the problem:

Index: test/unit/mailer_test.rb
===================================================================
--- test/unit/mailer_test.rb    (revision 16332)
+++ test/unit/mailer_test.rb    (working copy)
@@ -645,11 +645,18 @@
       ActionMailer::Base.deliveries.each do |mail|
         assert_mail_body_match 'Assigned to group', mail
       end
+
+      ActionMailer::Base.deliveries.clear
+
+      Mailer.reminders(:days => 7, :users => ['2'])
+      assert_equal 1, ActionMailer::Base.deliveries.size
+      assert_equal %w(jsmith@somenet.foo), ActionMailer::Base.deliveries.map(&:bcc).flatten.sort
+      assert_mail_body_match 'Assigned to group', ActionMailer::Base.deliveries.first
     end
   end

   def test_reminders_with_version_option
-    with_settings :default_language => 'en' do
+    with_settings :default_language => 'en' do
       version = Version.generate!(:name => 'Acme', :project_id => 1)
       Issue.generate!(:assigned_to => User.find(2), :due_date => 5.days.from_now)
       Issue.generate!(:assigned_to => User.find(3), :due_date => 5.days.from_now, :fixed_version => version)

Related issues

Blocks Redmine - Feature #2477: mail reminder for watchersNew2009-01-09

Actions
Actions #1

Updated by Go MAEDA over 7 years ago

Actions #2

Updated by Toshi MARUYAMA over 7 years ago

  • Description updated (diff)
Actions #3

Updated by Go MAEDA over 1 year ago

The issue is still reproducible in Redmine 5.0.

diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb
index 07b7d27ae..1c238322a 100644
--- a/test/unit/mailer_test.rb
+++ b/test/unit/mailer_test.rb
@@ -908,6 +908,13 @@ class MailerTest < ActiveSupport::TestCase
           mail
         )
       end
+
+      ActionMailer::Base.deliveries.clear
+
+      Mailer.reminders(:days => 7, :users => ['2'])
+      assert_equal 1, ActionMailer::Base.deliveries.size
+      assert_equal %w(jsmith@somenet.foo), ActionMailer::Base.deliveries.map(&:bcc).flatten.sort
+      assert_mail_body_match 'Assigned to group', ActionMailer::Base.deliveries.first
     end
   end

Actions #4

Updated by Yuichi HARADA over 1 year ago

As written in source:/trunk/lib/tasks/reminder.rake#L25, I think the solution would be to specify the ids of the group in the users parameter.

Actions

Also available in: Atom PDF