jdtornow / challah

User authorization and session management in Rails.
MIT License
18 stars 7 forks source link

Adding a registration mailer #7

Closed mlncstr closed 10 years ago

mlncstr commented 10 years ago

How would I add a mailer to your create method?

new_user = User.create( email: params[:session][:username], password: params[:session][:password], password_confirmation: params[:session][:password] ) if !existing_user && params[:customer_type] == "new"

Not entirely sure where the best place to put this would be: UserRegistration.new_registration(@user.id).deliver

jdtornow commented 10 years ago

Hey @markmakes --

We typically put this type of thing in the registration/signup controller, right after the user is created. As soon as you hit User.create it will create the user record (assuming it is valid) and you can then send out the welcome email.

Hope that helps..

mlncstr commented 10 years ago

This does, thanks John!

jdtornow commented 10 years ago

Great, you bet.