TJ Sherrill
TJ Sherrill

Reputation: 2645

Rails 3, devise, how can I send the confirmation email even if devise is not set to confirmable?

Maybe this is simple and I haven't figured it out yet, but I want to send the confirmation email that is created when you run the devise views command.

I am running the following model method:

def send_invitation
     User.find(self).send_confirmation_instructions
   end

but when I run this I get

undefined method `send_confirmation_instructions'

there is a mailer in views/devise/mailer/confirm_instructions.html.erb

Is there a way to send that email without setting users to confirmable?

Upvotes: 1

Views: 579

Answers (1)

Dan Wich
Dan Wich

Reputation: 4943

I don't fully understand the points at which you do/don't want the confirmation feature, but you could include Confirmable but override the methods for the Confirmable features you don't want. Or you could call User.skip_confirmation! after users are created, which automatically "confirms" the user, bypassing Confirmable when you don't want it.

Upvotes: 1

Related Questions