Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/merge_requests.rb9
-rw-r--r--app/mailers/emails/profile.rb11
-rw-r--r--app/mailers/emails/reviews.rb4
-rw-r--r--app/mailers/previews/notify_preview.rb4
4 files changed, 27 insertions, 1 deletions
diff --git a/app/mailers/emails/merge_requests.rb b/app/mailers/emails/merge_requests.rb
index d2e710cc329..341accaea32 100644
--- a/app/mailers/emails/merge_requests.rb
+++ b/app/mailers/emails/merge_requests.rb
@@ -14,10 +14,17 @@ module Emails
mail_answer_thread(@merge_request, merge_request_thread_options(updated_by_user_id, reason))
end
- def push_to_merge_request_email(recipient_id, merge_request_id, updated_by_user_id, reason = nil, new_commits: [], existing_commits: [])
+ # existing_commits - an array containing the first and last commits
+ def push_to_merge_request_email(recipient_id, merge_request_id, updated_by_user_id, reason = nil, new_commits: [], total_new_commits_count: nil, existing_commits: [], total_existing_commits_count: nil)
setup_merge_request_mail(merge_request_id, recipient_id)
+
@new_commits = new_commits
+ @total_new_commits_count = total_new_commits_count || @new_commits.length
+ @total_stripped_new_commits_count = @total_new_commits_count - @new_commits.length
+
@existing_commits = existing_commits
+ @total_existing_commits_count = total_existing_commits_count || @existing_commits.length
+
@updated_by_user = User.find(updated_by_user_id)
mail_answer_thread(@merge_request, merge_request_thread_options(updated_by_user_id, reason))
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb
index 28e51ba311b..31fcc7c15cb 100644
--- a/app/mailers/emails/profile.rb
+++ b/app/mailers/emails/profile.rb
@@ -141,6 +141,17 @@ module Emails
end
end
+ def new_email_address_added_email(user, email)
+ return unless user
+
+ @user = user
+ @email = email
+
+ Gitlab::I18n.with_locale(@user.preferred_language) do
+ mail(to: @user.notification_email_or_default, subject: subject(_("New email address added")))
+ end
+ end
+
private
def profile_email_with_layout(to:, subject:, layout: 'mailer')
diff --git a/app/mailers/emails/reviews.rb b/app/mailers/emails/reviews.rb
index ddb9e161a80..b98fa8aa6c9 100644
--- a/app/mailers/emails/reviews.rb
+++ b/app/mailers/emails/reviews.rb
@@ -22,6 +22,10 @@ module Emails
review = Review.find_by_id(review_id)
@notes = review.notes
+ @discussions = Discussion.build_discussions(review.discussion_ids, preload_note_diff_file: true)
+ @include_diff_discussion_stylesheet = @discussions.values.any? do |discussion|
+ discussion.diff_discussion? && discussion.on_text?
+ end
@author = review.author
@author_name = review.author_name
@project = review.project
diff --git a/app/mailers/previews/notify_preview.rb b/app/mailers/previews/notify_preview.rb
index 8e30eeee73f..e7c8964a733 100644
--- a/app/mailers/previews/notify_preview.rb
+++ b/app/mailers/previews/notify_preview.rb
@@ -181,6 +181,10 @@ class NotifyPreview < ActionMailer::Preview
Notify.unknown_sign_in_email(user, '127.0.0.1', Time.current).message
end
+ def new_email_address_added_email
+ Notify.new_email_address_added_email(user, 'someone@gitlab.com').message
+ end
+
def service_desk_new_note_email
cleanup do
note = create_note(noteable_type: 'Issue', noteable_id: issue.id, note: 'Issue note content')