From fe57bd88e85531b02d595a522dd12d3803483d9e Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sat, 5 Aug 2017 06:03:02 +0200 Subject: [PATCH] Add ApplicationMailer --- app/mailers/application_mailer.rb | 3 +++ app/mailers/diaspora_devise_mailer.rb | 2 +- app/mailers/export_mailer.rb | 4 +--- app/mailers/maintenance.rb | 4 +--- app/mailers/notifier.rb | 2 +- app/mailers/report_mailer.rb | 4 +--- 6 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 app/mailers/application_mailer.rb diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 000000000..e5ed1ffd0 --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,3 @@ +class ApplicationMailer < ActionMailer::Base + default from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>" +end diff --git a/app/mailers/diaspora_devise_mailer.rb b/app/mailers/diaspora_devise_mailer.rb index 9a18ffb38..069b488b5 100644 --- a/app/mailers/diaspora_devise_mailer.rb +++ b/app/mailers/diaspora_devise_mailer.rb @@ -1,5 +1,5 @@ class DiasporaDeviseMailer < Devise::Mailer - default :from => AppConfig.mail.sender_address + default from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>" def self.mailer_name "devise/mailer" diff --git a/app/mailers/export_mailer.rb b/app/mailers/export_mailer.rb index a0bc8b5e5..5139be734 100644 --- a/app/mailers/export_mailer.rb +++ b/app/mailers/export_mailer.rb @@ -1,6 +1,4 @@ -class ExportMailer < ActionMailer::Base - default from: AppConfig.mail.sender_address - +class ExportMailer < ApplicationMailer def export_complete_for(user) @user = user diff --git a/app/mailers/maintenance.rb b/app/mailers/maintenance.rb index 6b0f2e07b..185b4f949 100644 --- a/app/mailers/maintenance.rb +++ b/app/mailers/maintenance.rb @@ -1,6 +1,4 @@ -class Maintenance < ActionMailer::Base - default :from => AppConfig.mail.sender_address - +class Maintenance < ApplicationMailer def account_removal_warning(user) @user = user @login_url = new_user_session_url diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index d58a58761..187c7b0ed 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -1,4 +1,4 @@ -class Notifier < ActionMailer::Base +class Notifier < ApplicationMailer helper :application helper :notifier helper :people diff --git a/app/mailers/report_mailer.rb b/app/mailers/report_mailer.rb index 498413367..0ac76892f 100644 --- a/app/mailers/report_mailer.rb +++ b/app/mailers/report_mailer.rb @@ -1,6 +1,4 @@ -class ReportMailer < ActionMailer::Base - default from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>" - +class ReportMailer < ApplicationMailer def self.new_report(report_id) report = Report.find_by_id(report_id) Role.moderators.map {|role| super(report.item_type, report.item_id, report.text, role) }