diff options
Diffstat (limited to 'app/mailers/emails')
-rw-r--r-- | app/mailers/emails/merge_requests.rb | 8 | ||||
-rw-r--r-- | app/mailers/emails/pipelines.rb | 2 | ||||
-rw-r--r-- | app/mailers/emails/profile.rb | 5 | ||||
-rw-r--r-- | app/mailers/emails/service_desk.rb | 10 |
4 files changed, 17 insertions, 8 deletions
diff --git a/app/mailers/emails/merge_requests.rb b/app/mailers/emails/merge_requests.rb index 494d9875ce4..e538b5e4718 100644 --- a/app/mailers/emails/merge_requests.rb +++ b/app/mailers/emails/merge_requests.rb @@ -23,6 +23,14 @@ module Emails mail_answer_thread(@merge_request, merge_request_thread_options(updated_by_user_id, recipient_id, reason)) end + def change_in_merge_request_draft_status_email(recipient_id, merge_request_id, updated_by_user_id, reason = nil) + setup_merge_request_mail(merge_request_id, recipient_id) + + @updated_by_user = User.find(updated_by_user_id) + + mail_answer_thread(@merge_request, merge_request_thread_options(updated_by_user_id, recipient_id, reason)) + end + # rubocop: disable CodeReuse/ActiveRecord def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_ids, updated_by_user_id, reason = nil) setup_merge_request_mail(merge_request_id, recipient_id) diff --git a/app/mailers/emails/pipelines.rb b/app/mailers/emails/pipelines.rb index 0b830f4ee5e..fb1f70723fd 100644 --- a/app/mailers/emails/pipelines.rb +++ b/app/mailers/emails/pipelines.rb @@ -3,7 +3,7 @@ module Emails module Pipelines def pipeline_success_email(pipeline, recipients) - pipeline_mail(pipeline, recipients, 'Succesful') + pipeline_mail(pipeline, recipients, 'Successful') end def pipeline_failed_email(pipeline, recipients) diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb index e3c72a343e7..f13ba9caee0 100644 --- a/app/mailers/emails/profile.rb +++ b/app/mailers/emails/profile.rb @@ -50,15 +50,16 @@ module Emails end # rubocop: enable CodeReuse/ActiveRecord - def access_token_about_to_expire_email(user) + def access_token_about_to_expire_email(user, token_names) return unless user @user = user + @token_names = token_names @target_url = profile_personal_access_tokens_url @days_to_expire = PersonalAccessToken::DAYS_TO_EXPIRE Gitlab::I18n.with_locale(@user.preferred_language) do - mail(to: @user.notification_email, subject: subject(_("Your Personal Access Tokens will expire in %{days_to_expire} days or less") % { days_to_expire: @days_to_expire })) + mail(to: @user.notification_email, subject: subject(_("Your personal access tokens will expire in %{days_to_expire} days or less") % { days_to_expire: @days_to_expire })) end end diff --git a/app/mailers/emails/service_desk.rb b/app/mailers/emails/service_desk.rb index 4dceff5b7ba..66eb2c646a9 100644 --- a/app/mailers/emails/service_desk.rb +++ b/app/mailers/emails/service_desk.rb @@ -17,18 +17,18 @@ module Emails send_from_user_email: false, sender_name: @project.service_desk_setting&.outgoing_name ) - options = service_desk_options(email_sender, 'thank_you') + options = service_desk_options(email_sender, 'thank_you', @issue.external_author) .merge(subject: "Re: #{subject_base}") mail_new_thread(@issue, options) end - def service_desk_new_note_email(issue_id, note_id) + def service_desk_new_note_email(issue_id, note_id, recipient) @note = Note.find(note_id) setup_service_desk_mail(issue_id) email_sender = sender(@note.author_id) - options = service_desk_options(email_sender, 'new_note') + options = service_desk_options(email_sender, 'new_note', recipient) .merge(subject: subject_base) mail_answer_thread(@issue, options) @@ -44,10 +44,10 @@ module Emails @sent_notification = SentNotification.record(@issue, @support_bot.id, reply_key) end - def service_desk_options(email_sender, email_type) + def service_desk_options(email_sender, email_type, recipient) { from: email_sender, - to: @issue.external_author + to: recipient }.tap do |options| next unless template_body = template_content(email_type) |