]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
Use new ActionMail API to send emails
[rails.git] / app / controllers / user_controller.rb
index 70328f5a5d637f3f1b6b2116d697692e28caf0c3..92b0f778af3d84595341ed9578747927ab7b0d1d 100644 (file)
@@ -128,8 +128,9 @@ class UserController < ApplicationController
       @user.openid_url = nil if @user.openid_url and @user.openid_url.empty?
       
       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
@@ -213,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
@@ -355,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]
@@ -418,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
@@ -652,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