Project

General

Profile

Actions

Defect #14400

open

Email Reminder doesn't have the right behavior

Added by Benjamin Billon over 11 years ago. Updated about 11 years ago.

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

0%

Estimated time:
Resolution:
Affected version:

Description

Hello there,

Let's start by a small complaint.
Here https://github.com/chantra/redmine_whining/issues/25, it is said that

redmine now include the rake task send_reminders.
So this plugin is now redundant.

WELL, not exactly. Redmine Whining had the bright idea to send a reminder to assignees who didn't process a ticket for X days.
The send_reminders now included in Redmine sends a reminder to assignees whose issue's due date is in X days.
Quite a difference here, notably when the due date is empty or rarely used.

While patching send_reminders (./app/models/mailer.rb) to meet my needs, I've encountered the following:

scope = Issue.open.where("#{Issue.table_name}.assigned_to_id IS NOT NULL" +
      " AND #{Project.table_name}.status = #{Project::STATUS_ACTIVE}" +
      " AND #{Issue.table_name}.due_date >= ?", days.day.from_now.to_date
    )

for which the last line would generate something like
 AND issues.due_date >= 'Fri, 12 Jul 2013'

issues.due_date being of type DATE, that is just not going to work properly.

For those interested, I replaced the line by

" AND DATEDIFF(NOW(),#{Issue.table_name}.updated_on) >= ?", days


Files

Actions

Also available in: Atom PDF