Search code examples
ruby-on-rails-3deviseemail-confirmation

How can I send a registration confirmation email with devise


I'm building a rails3 application (hosted on Heroku) and I'm using devise for user authentication. I would like to send a confirmation email every time a new user signs up to my app, that is confirming that he has successfully signed up etc.

Note: I do not want to confirm his email address, i.e. I dont want to use the :confirmable devise module.

Problem is, I cannot find any relevant devise or user controller action to add a mailer .deliver action.

Thanks for your help!


Solution

  • How about firing it off from your model (user.rb)?

    #user.rb
    after_create :some_method
    def some_method
      YourMailerObject.deliver_some_message()
    end