|
|
|
@ -13,12 +13,14 @@ class NotificationMailer < ApplicationMailer
|
|
|
|
|
before_action :set_account, only: [:follow, :favourite, :reblog, :follow_request]
|
|
|
|
|
after_action :set_list_headers!
|
|
|
|
|
|
|
|
|
|
before_deliver :verify_functional_user
|
|
|
|
|
|
|
|
|
|
default to: -> { email_address_with_name(@user.email, @me.username) }
|
|
|
|
|
|
|
|
|
|
layout 'mailer'
|
|
|
|
|
|
|
|
|
|
def mention
|
|
|
|
|
return unless @user.functional? && @status.present?
|
|
|
|
|
return if @status.blank?
|
|
|
|
|
|
|
|
|
|
locale_for_account(@me) do
|
|
|
|
|
mail subject: default_i18n_subject(name: @status.account.acct)
|
|
|
|
@ -26,15 +28,13 @@ class NotificationMailer < ApplicationMailer
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def follow
|
|
|
|
|
return unless @user.functional?
|
|
|
|
|
|
|
|
|
|
locale_for_account(@me) do
|
|
|
|
|
mail subject: default_i18n_subject(name: @account.acct)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def favourite
|
|
|
|
|
return unless @user.functional? && @status.present?
|
|
|
|
|
return if @status.blank?
|
|
|
|
|
|
|
|
|
|
locale_for_account(@me) do
|
|
|
|
|
mail subject: default_i18n_subject(name: @account.acct)
|
|
|
|
@ -42,7 +42,7 @@ class NotificationMailer < ApplicationMailer
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def reblog
|
|
|
|
|
return unless @user.functional? && @status.present?
|
|
|
|
|
return if @status.blank?
|
|
|
|
|
|
|
|
|
|
locale_for_account(@me) do
|
|
|
|
|
mail subject: default_i18n_subject(name: @account.acct)
|
|
|
|
@ -50,8 +50,6 @@ class NotificationMailer < ApplicationMailer
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def follow_request
|
|
|
|
|
return unless @user.functional?
|
|
|
|
|
|
|
|
|
|
locale_for_account(@me) do
|
|
|
|
|
mail subject: default_i18n_subject(name: @account.acct)
|
|
|
|
|
end
|
|
|
|
@ -75,6 +73,10 @@ class NotificationMailer < ApplicationMailer
|
|
|
|
|
@account = @notification.from_account
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def verify_functional_user
|
|
|
|
|
throw(:abort) unless @user.functional?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def set_list_headers!
|
|
|
|
|
headers(
|
|
|
|
|
'List-ID' => "<#{@type}.#{@me.username}.#{Rails.configuration.x.local_domain}>",
|
|
|
|
|