プロジェクト

全般

プロフィール

Vote #69884

未完了

Enhance reminder email to send all assigned issues

Admin Redmine さんがほぼ4年前に追加. ほぼ4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Email notifications_9
対象バージョン:
-
開始日:
2011/05/11
期日:
進捗率:

0%

予定工数:
category_id:
9
version_id:
0
issue_org_id:
8342
author_id:
5838
assigned_to_id:
0
comments:
2
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Currently the reminder email requires that issues have a due date to send the reminder email. It might also be useful to have a reminder email for overdue issues.

To implement, this, I'd like to propose adding the following code. I did consider modifying the reminder function, but I was concerned about not changing current functionality and impacts on localisation.

File: @lib/tasks/reminder.rake@

  task :send_reminders_assigned => :environment do
    options = {}
    options[:project] = ENV['project'] if ENV['project']
    options[:tracker] = ENV['tracker'].to_i if ENV['tracker']
    options[:users] = (ENV['users'] || '').split(',').each(&:strip!)

    Mailer.reminders_assigned(options)
  end

File: @app/models/mailer.rb@

  def reminder_assigned(user, issues)
    set_language_if_valid user.language
    recipients user.mail
    subject l(:mail_subject_reminder_assigned, :count => issues.size)
    body :issues => issues,
         :issues_url => url_for(:controller => 'issues', :action => 'index', :set_filter => 1, :assigned_to_id => user.\
id, :sort => 'due_date:asc')
    render_multipart('reminder_assigned', body)
  end

  # Sends reminders to issue assignees
  # Available options:
  # * :tracker  => id of tracker for filtering issues (defaults to all trackers)
  # * :project  => id or identifier of project to process (defaults to all projects)
  # * :users    => array of user ids who should be reminded
  def self.reminders_assigned(options={})
    project = options[:project] ? Project.find(options[:project]) : nil
    tracker = options[:tracker] ? Tracker.find(options[:tracker]) : nil
    user_ids = options[:users]

    s = ARCondition.new ["#{IssueStatus.table_name}.is_closed = ?", false]
    s << "#{Issue.table_name}.assigned_to_id IS NOT NULL"
    s << ["#{Issue.table_name}.assigned_to_id IN (?)", user_ids] if user_ids.present?
    s << "#{Project.table_name}.status = #{Project::STATUS_ACTIVE}"
    s << "#{Issue.table_name}.project_id = #{project.id}" if project
    s << "#{Issue.table_name}.tracker_id = #{tracker.id}" if tracker

    issues_by_assignee = Issue.find(:all, :include => [:status, :assigned_to, :project, :tracker],
                                          :conditions => s.conditions
                                    ).group_by(&:assigned_to)
    issues_by_assignee.each do |assignee, issues|
      deliver_reminder_assigned(assignee, issues) if assignee && assignee.active?
    end
  end

In addition to the above, the following changes are required:

  • new file: @app/views/mailer/reminder_assigned.text.html.rhtml@
  • new file: @app/views/mailer/reminder_assigned.text.plain.rhtml@
  • new localisation: @mail_subject_reminder_assigned@
  • new localisation: @mail_body_reminder_assigned@

I can create a patch of these changes if helpful.


journals

Hi All,

I was just talking in IRC about this feature and really hope some1 is going to pick it up. Keep up the good work!
--------------------------------------------------------------------------------
Related to #415 ?
--------------------------------------------------------------------------------


related_issues

relates,New,415,Daily Digest option for Mail Notifications

Admin Redmine さんがほぼ4年前に更新

  • カテゴリEmail notifications_9 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0