Re: [devise] reconfirmable doesnt send out email.

221 views
Skip to first unread message

Carlos Antonio da Silva

unread,
Jul 8, 2012, 12:45:31 PM7/8/12
to plataforma...@googlegroups.com
This one should be triggered only when the user gets created, I think you'd like to check send_confirmation_instructions instead.

Also, you can just write the methods in your model instead of trying to monkey patch devise. These methods are all included in your User model.

    def send_confirmation_instructions
      debugger;
      super
    end

Something like that.

-- 
At.
Carlos Antonio

On Thursday, July 5, 2012 at 3:39 PM, j.n. wrote:

send_on_create_confirmation_instructions

j.n.

unread,
Jul 8, 2012, 4:28:33 PM7/8/12
to plataforma...@googlegroups.com
good point. Unfortuneately send_confirmation_instructions does not get triggered ether....

any hints appreciated :o)

Am Donnerstag, 5. Juli 2012 20:39:17 UTC+2 schrieb j.n.:
Hi.
I am trying to setup reconfirmable, so a user needs to reconfirm when changing his email address. Its a very nice feature, but I cant get it to work properly.

My setup is with devise 2.1.2 is:

user model:
attr_accessible  :email, :password, :password_confirmation, :unconfirmed_email, ...
devise :invitable, :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :confirmable, :omniauthable

in the initilizer devise.rb:
config.reconfirmable = true
(config.allow_unconfirmed_access_for = 0.days)
(config.reset_password_within = 12.hours)

in the form the model field unconfirmed_email get set properly. I checked this through the console.

The first confirmation email, when a user registers on the page gets send out without problem.

I tried debugging the problem with adding this code to the initializers directory to overwrite the devise methode that it triggered as a after_update hook:

module Devise::Models::Confirmable
  def send_on_create_confirmation_instructions
    debugger
  end
end

it seems like send_on_create_confirmation_instructions is never called, since I never get to the debugger.

Does anybody has experiences with this or was facing a similar problem?

Tankfull for any help,
Jan

Carlos Antonio da Silva

unread,
Jul 14, 2012, 5:25:52 PM7/14/12
to plataforma...@googlegroups.com
I haven't used reconfirmable yet, so I can't say for sure. You'd have to do some debugging when changing the email to check what devise methods are being triggered and why the email itself is not, sorry.

-- 
At.
Carlos Antonio

Reply all
Reply to author
Forward
0 new messages