In my model/user.rb
I have the following overwrite:
def send_on_create_confirmation_instructions
Devise::Mailer.delay.confirmation_instructions(self)
end
It gets called when someone registers but throws this error:
ArgumentError: wrong number of arguments (given 1, expected 2..3)
while this is the last line of the stack trace:
lib/ruby/gems/2.3.0/gems/devise-4.0.1/app/mailers/devise/mailer.rb:5:in `confirmation_instructions'
Whis is this method:
def confirmation_instructions(record, token, opts={})
@token = token
devise_mail(record, :confirmation_instructions, opts)
end
Clearly I'm passing the record, but not the token. I can't figure out where to get it from, in order to pass it, though. What am I missing?
Why are you call confimation_instruction
directly.
Try next:
User.find(1).send_confirmation_instructions
It's takes care about token.