1

I've installed Devise and its up and working correctly. However, there's an extra step in the User registration that I'd like to add. Instead of the Confirmation email being sent only to the user, I want the email also sent to the an Admin/Sitemaster. Also, I'll be adding a role field to the User model.

I want to be able to have the User sign up, receive an email that they've signed up correctly, then Admin also receive an email saying that a User has requested access, then Admin will give them a role.

My thinking is that there will be 3 roles. Uncofirmed User, Confirmed User, and Admin. so an Unconfirmed User is one that has simply signed up. Confirmed user is one that's been approved by Admin.

Mundo Calderon
  • 183
  • 2
  • 10
  • Override the confirmation_instructions method of the Devise::Mailer and add a blind carbon copy (bcc: "some@example.com") to whatever email you want the copy to go to. http://stackoverflow.com/questions/6271093/rails-3-devise-how-to-modify-the-mailer-method-for-confirmation-emails-to-add – John Jul 27 '12 at 01:16
  • Thanks! That worked to make it so that two people received copies of the email. However, I ended up wanting to send out two different emails out to each person. – Mundo Calderon Aug 22 '12 at 22:03

1 Answers1

0

Per John's suggestions, I overrode the method in the mailer and was able to send the email to two different folks, but then I decided that's not what I wanted to needed.

I instead overrode the create method in the RegistrationsController so that it sends makes two calls to the Mailer. So that the User that is requesting the registration gets an email that says, "Cool, you signed up, we'll get back to you." and the Admin gets an email saying, "hey, User just requested access."

Mundo Calderon
  • 183
  • 2
  • 10