Skip to content

Email notifications for Work Items CSV import

What does this MR do and why?

Emails user when work items are imported via CSV.

Depends on !110724 (merged).

Screenshots

image

Currently only title is required.

How to set up and validate locally

In console:

project = Project.find(1)
user = User.find(1) # user with sufficient access to project
Feature.enable(:import_work_items_csv)
csv_io = FileUploader.new(project)
csv_io.store!(File.open("/path/to/work_items.csv"))
service = ::WorkItems::ImportCsvService.new(user, project, csv_io)
service.execute

You can also just check the mail bit by feeding it a project and some fake results:

Notify.import_work_items_csv_email(user.id, project.id, {:success=>2, :error_lines=>[3,4], :parse_error=>false}).deliver!

Check the letter_opener for incoming mail. 👉 http://gdk.test:3443/rails/letter_opener.

You can also view sample mailer with fake info in http://localhost:3000/rails/mailers/notify/import_work_items_csv_email. If you play with the values on your local in app/mailers/previews/notify_preview.rb you can preview different what different values will look like.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #379153 (closed)

Edited by charlie ablett

Merge request reports

Loading