diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index ef1f9e8..8f8137d 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -190,6 +190,10 @@ class MailHandler < ActionMailer::Base @@handler_options[:issue].clear journal = issue.init_journal(user) + # Reopen issue on new mail reply + if issue.closed? && Setting.mail_handler_reopen_on_reply? + issue.status = IssueStatus.named(Setting.mail_handler_reopen_status).first || IssueStatus.default + end issue.safe_attributes = issue_attributes_from_keywords(issue) issue.safe_attributes = {'custom_field_values' => custom_field_values_from_keywords(issue)} journal.notes = cleaned_up_text_body diff --git a/app/views/settings/_mail_handler.html.erb b/app/views/settings/_mail_handler.html.erb index 3da9773..3e44714 100644 --- a/app/views/settings/_mail_handler.html.erb +++ b/app/views/settings/_mail_handler.html.erb @@ -18,6 +18,14 @@
+<%= setting_check_box :mail_handler_reopen_on_reply, + :onclick => "if (this.checked) { Form.Element.enable('settings_mail_handler_reopen_status'); } else { Form.Element.disable('settings_mail_handler_reopen_status'); }" %>
+<%= setting_select :mail_handler_reopen_status, + IssueStatus.all.reject{|s| s.is_closed?}.collect{|s| [s.name, s.name]}, + :disabled => !Setting.mail_handler_reopen_on_reply? %>
+