diff --git a/app/mailers/scrap_notifier.rb b/app/mailers/scrap_notifier.rb index 8b4986d..232a6d9 100644 --- a/app/mailers/scrap_notifier.rb +++ b/app/mailers/scrap_notifier.rb @@ -1,4 +1,4 @@ -class Scrap::Notifier < ActionMailer::Base +class ScrapNotifier < ActionMailer::Base def notification(scrap) sender, receiver = scrap.sender, scrap.receiver @recipient = receiver.name diff --git a/app/models/scrap.rb b/app/models/scrap.rb index c1a48f5..362d696 100644 --- a/app/models/scrap.rb +++ b/app/models/scrap.rb @@ -25,7 +25,7 @@ class Scrap < ActiveRecord::Base after_create do |scrap| scrap.root.update_attribute('updated_at', DateTime.now) unless scrap.root.nil? - Scrap::Notifier.notification(scrap).deliver if scrap.send_notification? + ScrapNotifier.notification(scrap).deliver if scrap.send_notification? end before_validation :strip_all_html_tags diff --git a/app/views/scrap/notifier/notification.text.erb b/app/views/scrap/notifier/notification.text.erb deleted file mode 100644 index ec88a61..0000000 --- a/app/views/scrap/notifier/notification.text.erb +++ /dev/null @@ -1,16 +0,0 @@ -<%= _('Hi, %{recipient}!') % { :recipient => @recipient } %> - -<%= word_wrap(_('%{sender} (%{sender_link}) has left the following scrap for you:') % { :sender => @sender, :sender_link => url_for(@sender_link) }) %> - -------------------------------------------------------------------------------- -<%= word_wrap(@scrap_content) %> -------------------------------------------------------------------------------- - -<%= _('View this scrap on the wall') %>: -<%= url_for @wall_url %> - -<%= _("Greetings,") %> - --- -<%= _('%s team.') % @environment %> -<%= url_for @url %> diff --git a/app/views/scrap_notifier/notification.text.erb b/app/views/scrap_notifier/notification.text.erb new file mode 100644 index 0000000..ec88a61 --- /dev/null +++ b/app/views/scrap_notifier/notification.text.erb @@ -0,0 +1,16 @@ +<%= _('Hi, %{recipient}!') % { :recipient => @recipient } %> + +<%= word_wrap(_('%{sender} (%{sender_link}) has left the following scrap for you:') % { :sender => @sender, :sender_link => url_for(@sender_link) }) %> + +------------------------------------------------------------------------------- +<%= word_wrap(@scrap_content) %> +------------------------------------------------------------------------------- + +<%= _('View this scrap on the wall') %>: +<%= url_for @wall_url %> + +<%= _("Greetings,") %> + +-- +<%= _('%s team.') % @environment %> +<%= url_for @url %> -- libgit2 0.21.2