Alex Rivera | Logout

Using Rails and Devise, I want to send a welcome email on sign up.

Asked 2010-10-12T18:27:58.517
14

How can I send a welcoming email to the user when they sign up? I'm using the 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
Edit
Report

1 Answer

19

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

answered 2010-10-12T18:29:24.977

Your Answer