summaryrefslogtreecommitdiff
path: root/app/mailers/emails
diff options
context:
space:
mode:
Diffstat (limited to 'app/mailers/emails')
-rw-r--r--app/mailers/emails/issues.rb2
-rw-r--r--app/mailers/emails/members.rb19
-rw-r--r--app/mailers/emails/merge_requests.rb2
-rw-r--r--app/mailers/emails/pipelines.rb15
4 files changed, 32 insertions, 6 deletions
diff --git a/app/mailers/emails/issues.rb b/app/mailers/emails/issues.rb
index b2c1351bd28..c565df1a2ee 100644
--- a/app/mailers/emails/issues.rb
+++ b/app/mailers/emails/issues.rb
@@ -106,6 +106,8 @@ module Emails
@count = export_status.fetch(:rows_expected)
@written_count = export_status.fetch(:rows_written)
@truncated = export_status.fetch(:truncated)
+ @size_limit = ActiveSupport::NumberHelper
+ .number_to_human_size(Issuable::ExportCsv::BaseService::TARGET_FILESIZE)
filename = "#{project.full_path.parameterize}_issues_#{Date.today.iso8601}.csv"
attachments[filename] = { content: csv_data, mime_type: 'text/csv' }
diff --git a/app/mailers/emails/members.rb b/app/mailers/emails/members.rb
index 759181bd3cb..69f5fe1430a 100644
--- a/app/mailers/emails/members.rb
+++ b/app/mailers/emails/members.rb
@@ -114,6 +114,23 @@ module Emails
subject: subject('Invitation declined'))
end
+ def member_expiration_date_updated_email(member_source_type, member_id)
+ @member_source_type = member_source_type
+ @member_id = member_id
+
+ return unless member_exists?
+
+ subject = if member.expires?
+ _('Group membership expiration date changed')
+ else
+ _('Group membership expiration date removed')
+ end
+
+ member_email_with_layout(
+ to: member.user.notification_email_for(notification_group),
+ subject: subject(subject))
+ end
+
# rubocop: disable CodeReuse/ActiveRecord
def member
@member ||= Member.find_by(id: @member_id)
@@ -147,3 +164,5 @@ module Emails
end
end
end
+
+Emails::Members.prepend_if_ee('EE::Emails::Members')
diff --git a/app/mailers/emails/merge_requests.rb b/app/mailers/emails/merge_requests.rb
index 28ac752f550..4faa1a11276 100644
--- a/app/mailers/emails/merge_requests.rb
+++ b/app/mailers/emails/merge_requests.rb
@@ -115,6 +115,8 @@ module Emails
@count = export_status.fetch(:rows_expected)
@written_count = export_status.fetch(:rows_written)
@truncated = export_status.fetch(:truncated)
+ @size_limit = ActiveSupport::NumberHelper
+ .number_to_human_size(Issuable::ExportCsv::BaseService::TARGET_FILESIZE)
filename = "#{project.full_path.parameterize}_merge_requests_#{Date.current.iso8601}.csv"
attachments[filename] = { content: csv_data, mime_type: 'text/csv' }
diff --git a/app/mailers/emails/pipelines.rb b/app/mailers/emails/pipelines.rb
index f2538d28a1a..0b830f4ee5e 100644
--- a/app/mailers/emails/pipelines.rb
+++ b/app/mailers/emails/pipelines.rb
@@ -3,15 +3,15 @@
module Emails
module Pipelines
def pipeline_success_email(pipeline, recipients)
- pipeline_mail(pipeline, recipients, 'succeeded')
+ pipeline_mail(pipeline, recipients, 'Succesful')
end
def pipeline_failed_email(pipeline, recipients)
- pipeline_mail(pipeline, recipients, 'failed')
+ pipeline_mail(pipeline, recipients, 'Failed')
end
def pipeline_fixed_email(pipeline, recipients)
- pipeline_mail(pipeline, recipients, 'been fixed')
+ pipeline_mail(pipeline, recipients, 'Fixed')
end
private
@@ -50,10 +50,13 @@ module Emails
end
def pipeline_subject(status)
- commit = [@pipeline.short_sha]
- commit << "in #{@merge_request.to_reference}" if @merge_request
+ subject = []
- subject("Pipeline ##{@pipeline.id} has #{status} for #{@pipeline.source_ref}", commit.join(' '))
+ subject << "#{status} pipeline for #{@pipeline.source_ref}"
+ subject << @project.name if @project
+ subject << @pipeline.short_sha
+
+ subject.join(' | ')
end
end
end