summaryrefslogtreecommitdiff
path: root/app/mailers
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2018-12-06 08:51:30 +0800
committerHeinrich Lee Yu <hleeyu@gmail.com>2019-01-07 11:16:58 +0800
commit3c026971149c95f076b8c50a52ddbfed139d5b20 (patch)
tree6bf0e1e8e28968887156dd524dc37e498229a9e6 /app/mailers
parent876ab436fabf2f44e2a6912262f980256b7c9736 (diff)
downloadgitlab-ce-3c026971149c95f076b8c50a52ddbfed139d5b20.tar.gz
Import CSV Backend
Process CSV uploads async using a worker then email results
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/issues.rb11
-rw-r--r--app/mailers/previews/notify_preview.rb4
2 files changed, 15 insertions, 0 deletions
diff --git a/app/mailers/emails/issues.rb b/app/mailers/emails/issues.rb
index 370e6d2f90b..654ae211310 100644
--- a/app/mailers/emails/issues.rb
+++ b/app/mailers/emails/issues.rb
@@ -77,6 +77,17 @@ module Emails
mail_answer_thread(issue, issue_thread_options(updated_by_user.id, recipient.id, reason))
end
+ def import_issues_csv_email(user_id, project_id, results)
+ @user = User.find(user_id)
+ @project = Project.find(project_id)
+ @results = results
+
+ mail(to: @user.notification_email, subject: subject('Imported issues')) do |format|
+ format.html { render layout: 'mailer' }
+ format.text { render layout: 'mailer' }
+ end
+ end
+
private
def setup_issue_mail(issue_id, recipient_id)
diff --git a/app/mailers/previews/notify_preview.rb b/app/mailers/previews/notify_preview.rb
index 2ac4610967d..80e0a17c312 100644
--- a/app/mailers/previews/notify_preview.rb
+++ b/app/mailers/previews/notify_preview.rb
@@ -76,6 +76,10 @@ class NotifyPreview < ActionMailer::Preview
Notify.changed_milestone_issue_email(user.id, issue.id, milestone, user.id)
end
+ def import_issues_csv_email
+ Notify.import_issues_csv_email(user, project, { success: 3, errors: [5, 6, 7], valid_file: true })
+ end
+
def closed_merge_request_email
Notify.closed_merge_request_email(user.id, issue.id, user.id).message
end