I have already made Recoverable module working, so all my setting for mailing are set.
I need to add mettod in my mailer class:
def congrats(user, password)
@user = user
mail(:to => user.email,
:subject => 'Congrats message')
end
I will use http://railscasts.com/episodes/206-action-mailer-in-rails-3 railscast for doing this
BUT where I should call congrats method ? In after_sign_up_path_for or not ? What would be the best practice ?
I would say bast practice is to not spam your users with a bunch of different emails. However, the easiest way for you to implement this would be to turn on confirmable for your Devise model. And then put your welcome message in the confirmation email.
If you are not using confirmable, or are dead set against having just the one email, why not put this in a callback on your Devise model?
after_create :congrats_email
def congrats_email
mail(to: self.email, subject: "Welcome Message")
end
Either approach is easy enough to implement, you just need to decide which will best suit your users.