Rajat
Rajat

Reputation: 1836

Sending custom email message on devise user creation

So I need to send a confirmation email every time a user signs up. There are two ways of signing up -- either when a user hits my login page, or when he is invited by another user. In both cases, I want to send separate types of email (in the second case, I also want to tell them that you were sent invitation by [email protected] person etc.). What is the best way to do this? I am using devise for rails.

Upvotes: 1

Views: 328

Answers (1)

Dipak Panchal
Dipak Panchal

Reputation: 6036

use action mailer for sending email

you can send email by using callback means that if you user sign up then below method call

after_create :send_mail_to_xxx_xxx
def send_mail_to_xxx_xxx 
  ... 
  ...
end

Upvotes: 1

Related Questions