Commit 9b8228e7916180ebed861891c9266127a6e25324
1 parent
c6d40a34
Exists in
master
and in
20 other branches
rails4: use ApplicationMailer pattern
Showing
11 changed files
with
23 additions
and
22 deletions
Show diff stats
app/mailers/comment_notifier.rb
app/mailers/contact.rb
@@ -30,7 +30,7 @@ class Contact | @@ -30,7 +30,7 @@ class Contact | ||
30 | Contact::Sender.notification(self).deliver | 30 | Contact::Sender.notification(self).deliver |
31 | end | 31 | end |
32 | 32 | ||
33 | - class Sender < Noosfero::Mailer | 33 | + class Sender < ApplicationMailer |
34 | 34 | ||
35 | def notification(contact) | 35 | def notification(contact) |
36 | self.environment = contact.dest.environment | 36 | self.environment = contact.dest.environment |
app/mailers/mailing.rb
@@ -48,7 +48,7 @@ class Mailing < ActiveRecord::Base | @@ -48,7 +48,7 @@ class Mailing < ActiveRecord::Base | ||
48 | end | 48 | end |
49 | end | 49 | end |
50 | 50 | ||
51 | - class Sender < Noosfero::Mailer | 51 | + class Sender < ApplicationMailer |
52 | 52 | ||
53 | def notification(mailing, recipient) | 53 | def notification(mailing, recipient) |
54 | @message = mailing.body | 54 | @message = mailing.body |
app/mailers/pending_task_notifier.rb
app/mailers/scrap_notifier.rb
app/mailers/task_mailer.rb
app/mailers/user_mailer.rb
lib/noosfero/mailer.rb
lib/noosfero/plugin/mailer_base.rb
1 | -class Noosfero::Plugin::MailerBase < ActionMailer::Base | 1 | +require_relative '../../../app/mailers/application_mailer' |
2 | + | ||
3 | +class Noosfero::Plugin::MailerBase < ApplicationMailer | ||
2 | 4 | ||
3 | def self.plugin_name | 5 | def self.plugin_name |
4 | name.split('::').first.gsub(/Plugin$/, '').underscore | 6 | name.split('::').first.gsub(/Plugin$/, '').underscore |
plugins/work_assignment/lib/work_assignment_plugin/email_contact.rb
@@ -28,7 +28,7 @@ class WorkAssignmentPlugin::EmailContact | @@ -28,7 +28,7 @@ class WorkAssignmentPlugin::EmailContact | ||
28 | WorkAssignmentPlugin::EmailContact::EmailSender.notification(self).deliver | 28 | WorkAssignmentPlugin::EmailContact::EmailSender.notification(self).deliver |
29 | end | 29 | end |
30 | 30 | ||
31 | - class EmailSender < Noosfero::Mailer | 31 | + class EmailSender < ApplicationMailer |
32 | 32 | ||
33 | def notification(email_contact) | 33 | def notification(email_contact) |
34 | self.environment = email_contact.sender.environment | 34 | self.environment = email_contact.sender.environment |