Add missing mailer for quote notifications (#35652)
This commit is contained in:
@@ -6,7 +6,7 @@ class NotificationMailer < ApplicationMailer
|
||||
:routing
|
||||
|
||||
before_action :process_params
|
||||
with_options only: %i(mention favourite reblog) do
|
||||
with_options only: %i(mention favourite reblog quote) do
|
||||
before_action :set_status
|
||||
after_action :thread_by_conversation!
|
||||
end
|
||||
@@ -27,6 +27,14 @@ class NotificationMailer < ApplicationMailer
|
||||
end
|
||||
end
|
||||
|
||||
def quote
|
||||
return if @status.blank?
|
||||
|
||||
locale_for_account(@me) do
|
||||
mail subject: default_i18n_subject(name: @status.account.acct)
|
||||
end
|
||||
end
|
||||
|
||||
def follow
|
||||
locale_for_account(@me) do
|
||||
mail subject: default_i18n_subject(name: @account.acct)
|
||||
|
||||
@@ -30,6 +30,7 @@ class Notification < ApplicationRecord
|
||||
'FollowRequest' => :follow_request,
|
||||
'Favourite' => :favourite,
|
||||
'Poll' => :poll,
|
||||
'Quote' => :quote,
|
||||
}.freeze
|
||||
|
||||
# Please update app/javascript/api_types/notification.ts if you change this
|
||||
|
||||
@@ -43,6 +43,7 @@ class UserSettings
|
||||
setting :reblog, default: false
|
||||
setting :favourite, default: false
|
||||
setting :mention, default: true
|
||||
setting :quote, default: true
|
||||
setting :follow_request, default: true
|
||||
setting :report, default: true
|
||||
setting :pending_account, default: true
|
||||
|
||||
16
app/views/notification_mailer/quote.html.haml
Normal file
16
app/views/notification_mailer/quote.html.haml
Normal file
@@ -0,0 +1,16 @@
|
||||
= content_for :heading do
|
||||
= render 'application/mailer/heading',
|
||||
image_url: frontend_asset_url('images/mailer-new/heading/boost.png'),
|
||||
subtitle: t('notification_mailer.quote.body', name: @status.account.pretty_acct),
|
||||
title: t('notification_mailer.quote.title')
|
||||
%table.email-w-full{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
|
||||
%tr
|
||||
%td.email-body-padding-td
|
||||
%table.email-inner-card-table{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
|
||||
%tr
|
||||
%td.email-inner-card-td
|
||||
= render 'status', status: @status, time_zone: @me.user_time_zone
|
||||
%table.email-w-full{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
|
||||
%tr
|
||||
%td.email-padding-top-24
|
||||
= render 'application/mailer/button', text: t('notification_mailer.mention.action'), url: web_url("@#{@status.account.pretty_acct}/#{@status.id}")
|
||||
5
app/views/notification_mailer/quote.text.erb
Normal file
5
app/views/notification_mailer/quote.text.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<%= raw t('application_mailer.salutation', name: display_name(@me)) %>
|
||||
|
||||
<%= raw t('notification_mailer.quote.body', name: @status.account.pretty_acct) %>
|
||||
|
||||
<%= render 'status', status: @status %>
|
||||
@@ -18,6 +18,7 @@
|
||||
= ff.input :'notification_emails.reblog', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.reblog')
|
||||
= ff.input :'notification_emails.favourite', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.favourite')
|
||||
= ff.input :'notification_emails.mention', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.mention')
|
||||
= ff.input :'notification_emails.quote', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.quote')
|
||||
|
||||
.fields-group
|
||||
= ff.input :always_send_emails, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_always_send_emails'), hint: I18n.t('simple_form.hints.defaults.setting_always_send_emails')
|
||||
|
||||
Reference in New Issue
Block a user