diff options
author | ThibG <thib@sitedethib.com> | 2018-12-23 15:23:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-23 15:23:12 +0100 |
commit | 8a3e4a48838405a7a78f2b46cc2b2a7c8fa412fa (patch) | |
tree | b5d7908956cab9d18dceda381e18cdb4a6e0e4ba /app/mailers | |
parent | 1a3088364fe602bb48647d78dda440b174424e17 (diff) | |
parent | cb98e7dbd35c730a58f65112c3fa32ee180a2518 (diff) |
Merge pull request #871 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/application_mailer.rb | 1 | ||||
-rw-r--r-- | app/mailers/user_mailer.rb | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index bf161b9be..cc585c3b7 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -5,7 +5,6 @@ class ApplicationMailer < ActionMailer::Base helper :application helper :instance - helper :mailer protected diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index aa76b4dfe..8f3a4ab3a 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -78,4 +78,16 @@ class UserMailer < Devise::Mailer mail to: @resource.email, subject: I18n.t('user_mailer.backup_ready.subject') end end + + def warning(user, warning) + @resource = user + @warning = warning + @instance = Rails.configuration.x.local_domain + + I18n.with_locale(@resource.locale || I18n.default_locale) do + mail to: @resource.email, + subject: I18n.t("user_mailer.warning.subject.#{@warning.action}", acct: "@#{user.account.local_username_and_domain}"), + reply_to: Setting.site_contact_email + end + end end |