Merge tag 'v3.0.0' into hometown-dev
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
class AdminMailer < ApplicationMailer
|
||||
layout 'plain_mailer'
|
||||
|
||||
helper :stream_entries
|
||||
helper :statuses
|
||||
|
||||
def new_report(recipient, report)
|
||||
@report = report
|
||||
@ -24,4 +24,14 @@ class AdminMailer < ApplicationMailer
|
||||
mail to: @me.user_email, subject: I18n.t('admin_mailer.new_pending_account.subject', instance: @instance, username: @account.username)
|
||||
end
|
||||
end
|
||||
|
||||
def new_trending_tag(recipient, tag)
|
||||
@tag = tag
|
||||
@me = recipient
|
||||
@instance = Rails.configuration.x.local_domain
|
||||
|
||||
locale_for_account(@me) do
|
||||
mail to: @me.user_email, subject: I18n.t('admin_mailer.new_trending_tag.subject', instance: @instance, name: @tag.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class NotificationMailer < ApplicationMailer
|
||||
helper :stream_entries
|
||||
helper :statuses
|
||||
|
||||
add_template_helper RoutingHelper
|
||||
|
||||
|
@ -5,6 +5,7 @@ class UserMailer < Devise::Mailer
|
||||
|
||||
helper :application
|
||||
helper :instance
|
||||
helper :statuses
|
||||
|
||||
add_template_helper RoutingHelper
|
||||
|
||||
@ -56,6 +57,39 @@ class UserMailer < Devise::Mailer
|
||||
end
|
||||
end
|
||||
|
||||
def two_factor_enabled(user, **)
|
||||
@resource = user
|
||||
@instance = Rails.configuration.x.local_domain
|
||||
|
||||
return if @resource.disabled?
|
||||
|
||||
I18n.with_locale(@resource.locale || I18n.default_locale) do
|
||||
mail to: @resource.email, subject: I18n.t('devise.mailer.two_factor_enabled.subject')
|
||||
end
|
||||
end
|
||||
|
||||
def two_factor_disabled(user, **)
|
||||
@resource = user
|
||||
@instance = Rails.configuration.x.local_domain
|
||||
|
||||
return if @resource.disabled?
|
||||
|
||||
I18n.with_locale(@resource.locale || I18n.default_locale) do
|
||||
mail to: @resource.email, subject: I18n.t('devise.mailer.two_factor_disabled.subject')
|
||||
end
|
||||
end
|
||||
|
||||
def two_factor_recovery_codes_changed(user, **)
|
||||
@resource = user
|
||||
@instance = Rails.configuration.x.local_domain
|
||||
|
||||
return if @resource.disabled?
|
||||
|
||||
I18n.with_locale(@resource.locale || I18n.default_locale) do
|
||||
mail to: @resource.email, subject: I18n.t('devise.mailer.two_factor_recovery_codes_changed.subject')
|
||||
end
|
||||
end
|
||||
|
||||
def welcome(user)
|
||||
@resource = user
|
||||
@instance = Rails.configuration.x.local_domain
|
||||
@ -79,10 +113,11 @@ class UserMailer < Devise::Mailer
|
||||
end
|
||||
end
|
||||
|
||||
def warning(user, warning)
|
||||
def warning(user, warning, status_ids = nil)
|
||||
@resource = user
|
||||
@warning = warning
|
||||
@instance = Rails.configuration.x.local_domain
|
||||
@statuses = Status.where(id: status_ids).includes(:account) if status_ids.is_a?(Array)
|
||||
|
||||
I18n.with_locale(@resource.locale || I18n.default_locale) do
|
||||
mail to: @resource.email,
|
||||
|
Reference in New Issue
Block a user