From 5d3c60ae6f3628672769a8eae89391954af2c623 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 28 Nov 2023 02:41:26 -0500 Subject: [PATCH] Use `admin_mailer` layout with initial salutation (#28085) --- app/mailers/admin_mailer.rb | 2 ++ app/views/admin_mailer/new_appeal.text.erb | 2 -- app/views/admin_mailer/new_critical_software_updates.text.erb | 2 -- app/views/admin_mailer/new_pending_account.text.erb | 2 -- app/views/admin_mailer/new_report.text.erb | 2 -- app/views/admin_mailer/new_software_updates.text.erb | 2 -- app/views/admin_mailer/new_trends.text.erb | 2 -- app/views/layouts/admin_mailer.text.erb | 3 +++ 8 files changed, 5 insertions(+), 12 deletions(-) create mode 100644 app/views/layouts/admin_mailer.text.erb diff --git a/app/mailers/admin_mailer.rb b/app/mailers/admin_mailer.rb index 385e53c65742bb..2a6fbb0ab7e0a5 100644 --- a/app/mailers/admin_mailer.rb +++ b/app/mailers/admin_mailer.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class AdminMailer < ApplicationMailer + layout 'admin_mailer' + helper :accounts helper :languages diff --git a/app/views/admin_mailer/new_appeal.text.erb b/app/views/admin_mailer/new_appeal.text.erb index 8b85823608dc7b..0494f88985059f 100644 --- a/app/views/admin_mailer/new_appeal.text.erb +++ b/app/views/admin_mailer/new_appeal.text.erb @@ -1,5 +1,3 @@ -<%= raw t('application_mailer.salutation', name: display_name(@me)) %> - <%= raw t('admin_mailer.new_appeal.body', target: @appeal.account.username, action_taken_by: @appeal.strike.account.username, date: l(@appeal.strike.created_at, format: :with_time_zone), type: t(@appeal.strike.action, scope: 'admin_mailer.new_appeal.actions')) %> > <%= raw word_wrap(@appeal.text, break_sequence: "\n> ") %> diff --git a/app/views/admin_mailer/new_critical_software_updates.text.erb b/app/views/admin_mailer/new_critical_software_updates.text.erb index c901bc50f785ce..63c170dc0d6c83 100644 --- a/app/views/admin_mailer/new_critical_software_updates.text.erb +++ b/app/views/admin_mailer/new_critical_software_updates.text.erb @@ -1,5 +1,3 @@ -<%= raw t('application_mailer.salutation', name: display_name(@me)) %> - <%= raw t('admin_mailer.new_critical_software_updates.body') %> <%= raw t('application_mailer.view')%> <%= admin_software_updates_url %> diff --git a/app/views/admin_mailer/new_pending_account.text.erb b/app/views/admin_mailer/new_pending_account.text.erb index a8a2a35fa5555f..9eabb8f15084e8 100644 --- a/app/views/admin_mailer/new_pending_account.text.erb +++ b/app/views/admin_mailer/new_pending_account.text.erb @@ -1,5 +1,3 @@ -<%= raw t('application_mailer.salutation', name: display_name(@me)) %> - <%= raw t('admin_mailer.new_pending_account.body') %> <%= @account.user_email %> (@<%= @account.username %>) diff --git a/app/views/admin_mailer/new_report.text.erb b/app/views/admin_mailer/new_report.text.erb index f8a5224a10fc1a..8482225abe7994 100644 --- a/app/views/admin_mailer/new_report.text.erb +++ b/app/views/admin_mailer/new_report.text.erb @@ -1,5 +1,3 @@ -<%= raw t('application_mailer.salutation', name: display_name(@me)) %> - <%= raw(@report.account.local? ? t('admin_mailer.new_report.body', target: @report.target_account.pretty_acct, reporter: @report.account.pretty_acct) : t('admin_mailer.new_report.body_remote', target: @report.target_account.acct, domain: @report.account.domain)) %> <%= raw t('application_mailer.view')%> <%= admin_report_url(@report) %> diff --git a/app/views/admin_mailer/new_software_updates.text.erb b/app/views/admin_mailer/new_software_updates.text.erb index 2fc4d1a5f20107..96808f3cb3deba 100644 --- a/app/views/admin_mailer/new_software_updates.text.erb +++ b/app/views/admin_mailer/new_software_updates.text.erb @@ -1,5 +1,3 @@ -<%= raw t('application_mailer.salutation', name: display_name(@me)) %> - <%= raw t('admin_mailer.new_software_updates.body') %> <%= raw t('application_mailer.view')%> <%= admin_software_updates_url %> diff --git a/app/views/admin_mailer/new_trends.text.erb b/app/views/admin_mailer/new_trends.text.erb index 10b10e60453e80..4bcfa140105bae 100644 --- a/app/views/admin_mailer/new_trends.text.erb +++ b/app/views/admin_mailer/new_trends.text.erb @@ -1,5 +1,3 @@ -<%= raw t('application_mailer.salutation', name: display_name(@me)) %> - <%= raw t('admin_mailer.new_trends.body') %> <%= render partial: 'new_trending_links', object: @links unless @links.empty? %> diff --git a/app/views/layouts/admin_mailer.text.erb b/app/views/layouts/admin_mailer.text.erb new file mode 100644 index 00000000000000..298007ac87460c --- /dev/null +++ b/app/views/layouts/admin_mailer.text.erb @@ -0,0 +1,3 @@ +<%= raw t('application_mailer.salutation', name: display_name(@me)) %> + +<%= yield %>