Feature #13307

Start date and due date in email notifications

Added by Benjamin Jeanjean over 6 years ago. Updated 6 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Email notifications
Target version:4.1.0
Resolution:Fixed

Description

Today, the start date and the due date doesn't appears in the email sent when we create a new issue.
It would be really useful to make them appears for being aware of the priority of the issue.

issue_mailer_helper.diff Magnifier (666 Bytes) Marius BALTEANU, 2018-10-28 20:38

issue_mailer_helper-v2.diff Magnifier (750 Bytes) Go MAEDA, 2019-01-24 01:40

issue_mailer_helper-v3.diff Magnifier (753 Bytes) Go MAEDA, 2019-01-24 03:04

test-for-13307.diff Magnifier (790 Bytes) Go MAEDA, 2019-01-24 12:06


Related issues

Related to Redmine - Feature #10378: Don't show empty fields in email notifications Closed
Related to Redmine - Feature #18472: Due date and custom fileds in e-mail Closed
Duplicated by Redmine - Feature #29254: Start date and due date in issue email notification Closed

Associated revisions

Revision 17840
Added by Go MAEDA 6 months ago

Start date and due date in email notifications (#13307).

Patch by Senya Senya.

History

#1 Updated by Pavel Lautsevich over 6 years ago

+1

#2 Updated by Matt Mencel about 4 years ago

Anyone know if this is possible via a plugin? I have someone asking if these fields can be added to the notification email.

#3 Updated by Tiffany C about 4 years ago

Hi, I'm using Redmine2.4.1.
It works fine when I added "start_date" and "due_date" to issues_helper.rb as the following code.
Could you add to the latest Redmine, too? It would be really useful!

Index: app/helpers/issues_helper.rb  
===================================================================
--- app/helpers/issues_helper.rb>  
+++ app/helpers/issues_helper.rb>
@@ -233,7 +233,7 @@
_
def email_issue_attributes(issue, user) 
  items = [] 
- %w(author status priority assigned_to category fixed_version).each do |attribute|  
+ %w(author status priority assigned_to category fixed_version start_date due_date).each do |attribute|
 unless issue.disabled_core_fields.include?(attribute+"_id") 
items << "#{l("field_#{attribute}")}: #{issue.send attribute}"  
 end 

#4 Updated by Bryan Settles almost 3 years ago

In redmine/app/views/mailer/reminder.html.erb, put <%= issue.due_date issue.start_date > before the <= link_to_issue()%>

#5 Updated by Florian ROBERT about 2 years ago

+1

#6 Updated by ryan lee about 1 year ago

Hi, I am using Redmine 3.4.2.
I have edited the file 'app/helpers/issues_helper.rb' as Tiffany C's post but it not works.
I want the notification email include the info start date and due date.
If you have the solution please let me know. Thank you very much

#7 Updated by Yuuki NARA about 1 year ago

+1

#8 Updated by Senya Senya about 1 year ago

I posted a patch #29254

#9 Updated by Marius BALTEANU 9 months ago

  • Duplicated by Feature #29254: Start date and due date in issue email notification added

#10 Updated by Marius BALTEANU 9 months ago

Attached the patch uploaded by Senya Senya in #29254.

#11 Updated by Go MAEDA 9 months ago

  • Target version set to 4.1.0

+1
Start date and due date are important information for project management.

I am setting the target version to 4.1.0.

#12 Updated by Go MAEDA 8 months ago

  • Related to Feature #10378: Don't show empty fields in email notifications added

#13 Updated by Go MAEDA 6 months ago

I agree with showing start date and due date in reminders, But the current patch in #13307#note-10 needs some fix.

You can disable some standard fields in the tracker setting. Needless to say, disabled fields are not shown in reminders. However, start date and due date are always shown in reminders even if those fields are disabled.

When IssuesHelper#email_issue_attributes checks if a field name is included in the disabled_core_fields array, it assumes that the format of the value is "*_id". This does not work for start_date and due_date because those fields does not have the suffix "_id" in the disabled_core_fields array.

    %w(author status priority assigned_to category fixed_version start_date due_date).each do |attribute|
      unless issue.disabled_core_fields.include?(attribute+"_id")
        if html
          items << content_tag('strong', "#{l("field_#{attribute}")}: ") + (issue.send attribute)
        else
          items << "#{l("field_#{attribute}")}: #{issue.send attribute}" 
        end
      end
    end
$ bin/rails c
Loading development environment (Rails 5.2.2)
2.6.0 :001 > Tracker.find(1).disabled_core_fields
  Tracker Load (0.3ms)  SELECT  "trackers".* FROM "trackers" WHERE "trackers"."id" = ? LIMIT ?  [["id", 1], ["LIMIT", 1]]
 => ["assigned_to_id", "category_id", "fixed_version_id", "parent_issue_id", "start_date", "due_date", "estimated_hours", "done_ratio", "description"]

#14 Updated by Go MAEDA 6 months ago

Go MAEDA wrote:

When IssuesHelper#email_issue_attributes checks if a field name is included in the disabled_core_fields array, it assumes that the format of the value is "*_id". This does not work for start_date and due_date because those fields does not have the suffix "_id" in the disabled_core_fields array.

Here is an updated patch. The patch works whether the value in the disabled_core_fields array has "_id" suffix or not.

#15 Updated by Go MAEDA 6 months ago

Sorry, the patch issue_mailer_helper-v2.diff does not work. Here is a fixed patch.

#16 Updated by Go MAEDA 6 months ago

Updated a test for this feature.

#17 Updated by Go MAEDA 6 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you for your contribution.

#18 Updated by Go MAEDA 6 months ago

  • Subject changed from Start date and due date in email to Start date and due date in email notifications

#19 Updated by Go MAEDA 5 months ago

  • Related to Feature #18472: Due date and custom fileds in e-mail added

Also available in: Atom PDF