Modified: trunk/app/controllers/users_controller.rb (3032 => 3033)
--- trunk/app/controllers/users_controller.rb 2012-06-15 15:00:29 UTC (rev 3032)
+++ trunk/app/controllers/users_controller.rb 2012-06-17 07:15:14 UTC (rev 3033)
@@ -174,9 +174,20 @@
@user = User.new(params[:user])
respond_to do |format|
- if @user.save
- # DO NOT log in user yet, since account needs to be validated and activated first (through email).
- @user.send_email_confirmation_email
+
+ sent_email = false
+
+ if @user.valid?
+ begin
+ # DO NOT log in user yet, since account needs to be validated and activated first (through email).
+ @user.send_email_confirmation_email
+ sent_email = true
+ rescue
+ @user.errors.add_to_base("Unable to send confirmation email")
+ end
+ end
+
+ if sent_email && @user.save
# If required, copy the email address to the Profile
if params[:make_email_public]
@@ -195,7 +206,7 @@
}
end
- flash[:notice] = "Thank you for registering! We have sent a confirmation email to address@hidden with instructions on how to activate your account."
+ flash[:notice] = "Thank you for registering! An email has been sent to address@hidden with instructions on how to activate your account."
format.html { redirect_to(:action ="" "index") }
else
format.html { render :action ="" "new" }