Feature #22771
Option to send email notifications while importing issues from CSV files
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Email notifications | |||
Target version: | 4.1.0 | |||
Resolution: | Fixed |
Description
All email notifications are disabled for CSV import (source:trunk/app/models/issue_import.rb@15238#L65). Since no notifications are sent, assignees can't recognize issues which created and assigned by CSV importer unless they see issues list on screen.
I think it would be nice if users can choose either disable or enable email notifications when performing CSV import operation.
Associated revisions
Option to send email notifications while importing issues from CSV files (#22771).
Patch by Yuichi HARADA.
Update locales (#22771).
History
#1
Updated by Yuichi HARADA almost 4 years ago
- File 22771-add-option-email-notification.patch
added
+1
I do not know that I added issues because there is no notifications.
I made a patch, and attach it.
diff --git a/app/models/import.rb b/app/models/import.rb
index d2c53baac..01fe72d47 100644
--- a/app/models/import.rb
+++ b/app/models/import.rb
@@ -66,7 +66,8 @@ class Import < ActiveRecord::Base
'separator' => separator,
'wrapper' => wrapper,
'encoding' => encoding,
- 'date_format' => date_format
+ 'date_format' => date_format,
+ 'mail_notification' => '0'
)
end
diff --git a/app/models/issue_import.rb b/app/models/issue_import.rb
index ad04c0be5..a2925be32 100644
--- a/app/models/issue_import.rb
+++ b/app/models/issue_import.rb
@@ -77,7 +77,7 @@ class IssueImport < Import
def build_object(row, item)
issue = Issue.new
issue.author = user
- issue.notify = false
+ issue.notify = !!ActiveRecord::Type::Boolean.new.cast(settings['mail_notification'])
tracker_id = nil
if tracker
diff --git a/app/views/imports/settings.html.erb b/app/views/imports/settings.html.erb
index 6edfb10af..be504d30d 100644
--- a/app/views/imports/settings.html.erb
+++ b/app/views/imports/settings.html.erb
@@ -21,6 +21,12 @@
<label for="import_settings_date_format"><%= l(:setting_date_format) %></label>
<%= select_tag 'import_settings[date_format]', options_for_select(date_format_options, @import.settings['date_format']) %>
</p>
+ <hr/>
+ <p>
+ <label for="import_settings_mail_notification"><%= l(:field_mail_notification) %></label>
+ <%= hidden_field_tag 'import_settings[mail_notification]', '0', :id => nil %>
+ <%= check_box_tag 'import_settings[mail_notification]', '1', "#{@import.settings['mail_notification']}" == '1' %>
+ </p>
</fieldset>
<p><%= submit_tag l(:label_next).html_safe + " »".html_safe, :name => nil %></p>
<% end %>
#2
Updated by Go MAEDA over 3 years ago
- Target version set to Candidate for next major release
#3
Updated by Go MAEDA over 3 years ago
- File 22771-another-label.diff
added
- File label_import_notifications@2x.png added
- Target version changed from Candidate for next major release to 4.1.0
I have slightly modified the patch. Now the text of the label for the checkbox has the same style as label_project_copy_notifications
.
label_project_copy_notifications: Send email notifications during the project copy label_import_notifications: Send email notifications during the import
#4
Updated by Go MAEDA over 3 years ago
- File 22771-another-label-v2.diff
added
#5
Updated by Go MAEDA over 3 years ago
- Subject changed from Option to enable email notification for CSV import to Option to send email notifications while importing issues from CSV files
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patch. Thanks.