Cyril Duchon-Doris
Cyril Duchon-Doris

Reputation: 13949

Devise skip reconfirmation

I need to skip, not the confirmation email, but REconfirmation emails.

Suppose I have a user with a confirmed email. I want to manually change its email for testing/support purposes

u.email # => [email protected]
u.email = '[email protected]'
u.save
u.email # => [email protected]
u.unconfirmed_email # '[email protected]'

I tried u.skip_confirmation! before and after saving but it doesn't seem to help for reconfirmation emails... the unconfirmed email is not transferred to the email field

Is there any way to force the new unconfirmed email to switch to the normal email ?

Upvotes: 1

Views: 1589

Answers (1)

Sajan
Sajan

Reputation: 1923

That method only skips sending of mail, that does not confirm the new mail which is stored in unconfirmed_mail. maybe you could just confirm the user manually like u.confirm. confirm method works only after object is saved.

To skip reconfirmation email notification use : skip_confirmation_notification!

Here is the Code reference.

Or try skip_reconfirmation! this may confirm new email and avoid sending email notification. I have not used it but I understand so from the comment in code reference above(next method of skip_confirmation_notification! defination). so try it and let me know.

Upvotes: 2

Related Questions