views:

61

answers:

1

Hey,

how can I send welcoming email to user when one just signed up? I'm using Devise gem for authentication, SMTP is already set up; I just need to understand how to extend devise to send emails.

NOTE - this is not confirmation email!

UPD Solution:

class User < ActiveRecord::Base
  after_create :send_welcome_email 

  private

    def send_welcome_email
      UserMailer.deliver_welcome_email(self)
    end
end
+1  A: 

Add a callback (after_create ) in the model or observer to send the email using normal mailer methods.

David Lyod
Thanks! Added code to my original question
Vitaly