]> git.openstreetmap.org Git - rails.git/commitdiff
Use new ActionMail API to send emails
authorTom Hughes <tom@compton.nu>
Thu, 2 Sep 2010 22:40:49 +0000 (23:40 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 14 Nov 2011 09:42:41 +0000 (09:42 +0000)
app/controllers/diary_entry_controller.rb
app/controllers/message_controller.rb
app/controllers/user_controller.rb
lib/daemons/gpx_import.rb

index 13a8818fb063552a51e6ad13ff589d5aa8bd5859..47c638f3a2b0c68b8517d0fda4d11e4dbe7b0326 100644 (file)
@@ -60,7 +60,7 @@ class DiaryEntryController < ApplicationController
     @diary_comment.user = @user
     if @diary_comment.save
       if @diary_comment.user != @entry.user
-        Notifier::deliver_diary_comment_notification(@diary_comment)
+        Notifier.diary_comment_notification(@diary_comment).deliver
       end
 
       redirect_to :controller => 'diary_entry', :action => 'view', :display_name => @entry.user.display_name, :id => @entry.id
index 82e3f30f210d76888430784809b8e463cb8abf51..8f67328e752cd0cca1b1ba8d623bbd8f7d151a0b 100644 (file)
@@ -25,7 +25,7 @@ class MessageController < ApplicationController
 
           if @message.save
             flash[:notice] = t 'message.new.message_sent'
-            Notifier::deliver_message_notification(@message)
+            Notifier.message_notification(@message).deliver
             redirect_to :controller => 'message', :action => 'inbox', :display_name => @user.display_name
           end
         end
index 9c5ac0d09edf8bf400c196cb14b3ec3d54096082..92b0f778af3d84595341ed9578747927ab7b0d1d 100644 (file)
@@ -130,7 +130,7 @@ class UserController < ApplicationController
       if @user.save
         flash[:piwik_goal] = PIWIK_SIGNUP_GOAL if defined?(PIWIK_SIGNUP_GOAL)
         flash[:notice] = t 'user.new.flash create success message', :email => @user.email
-        Notifier.deliver_signup_confirm(@user, @user.tokens.create(:referer => session.delete(:referer)))
+        Notifier.signup_confirm(@user, @user.tokens.create(:referer => session.delete(:referer))).deliver
         session[:token] = @user.tokens.create.token
         redirect_to :action => 'login', :referer => params[:referer]
       else
@@ -214,7 +214,7 @@ class UserController < ApplicationController
 
       if user
         token = user.tokens.create
-        Notifier.deliver_lost_password(user, token)
+        Notifier.lost_password(user, token).deliver
         flash[:notice] = t 'user.lost_password.notice email on way'
         redirect_to :action => 'login'
       else
@@ -356,7 +356,7 @@ class UserController < ApplicationController
 
   def confirm_resend
     if user = User.find_by_display_name(params[:display_name])
-      Notifier.deliver_signup_confirm(user, user.tokens.create)
+      Notifier.signup_confirm(user, user.tokens.create).deliver
       flash[:notice] = t 'user.confirm_resend.success', :email => user.email
     else
       flash[:notice] = t 'user.confirm_resend.failure', :name => params[:display_name]
@@ -419,7 +419,7 @@ class UserController < ApplicationController
       unless @user.is_friends_with?(new_friend)
         if friend.save
           flash[:notice] = t 'user.make_friend.success', :name => name
-          Notifier.deliver_friend_notification(friend)
+          Notifier.friend_notification(friend).deliver
         else
           friend.add_error(t('user.make_friend.failed', :name => name))
         end
@@ -653,7 +653,7 @@ private
         flash.now[:notice] = t 'user.account.flash update success confirm needed'
 
         begin
-          Notifier.deliver_email_confirm(user, user.tokens.create)
+          Notifier.email_confirm(user, user.tokens.create).deliver
         rescue
           # Ignore errors sending email
         end
index 8250a67f55b8b1897ba90f9a8f938ce1f6348910..698e858ba375c27cf1d592bdf8e84617d371af6c 100755 (executable)
@@ -21,15 +21,15 @@ while(true) do
       gpx = trace.import
 
       if gpx.actual_points > 0
-        Notifier::deliver_gpx_success(trace, gpx.actual_points)
+        Notifier.gpx_success(trace, gpx.actual_points).deliver
       else
-        Notifier::deliver_gpx_failure(trace, '0 points parsed ok. Do they all have lat,lng,alt,timestamp?')
+        Notifier.gpx_failure(trace, '0 points parsed ok. Do they all have lat,lng,alt,timestamp?').deliver
         trace.destroy
       end
     rescue Exception => ex
       logger.info ex.to_s
       ex.backtrace.each {|l| logger.info l }
-      Notifier::deliver_gpx_failure(trace, ex.to_s + "\n" + ex.backtrace.join("\n"))
+      Notifier.gpx_failure(trace, ex.to_s + "\n" + ex.backtrace.join("\n")).deliver
       trace.destroy
     end