Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip_confirmation_notification! not working #679

Closed
arparthasarathi opened this issue Jul 15, 2016 · 2 comments
Closed

skip_confirmation_notification! not working #679

arparthasarathi opened this issue Jul 15, 2016 · 2 comments

Comments

@arparthasarathi
Copy link

The confirmation mail is sent automatically when a user is created. But I need to send the mail through code manually after completing a few more steps.

I can't able to prevent the confirmation mail from sending.

User model

class User < ActiveRecord::Base
  include DeviseTokenAuth::Concerns::User
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable,
         :confirmable
  before_create :skip_confirmation_notification!

Note: If I try to use skip_confirmation! it works perfectly without any flaw. But I don't need that functionality because I want to confirm the users only through the confirmation link sent to their mail.

@lynndylanhurley
Copy link
Owner

Try removing :confirmable from the list of devise methods at the top of your User model, then removing the before_create :skip_confirmation_notification!.

class User < ActiveRecord::Base
  include DeviseTokenAuth::Concerns::User
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

This should have the same effect as what you're trying to do. Then you can manually send the email later on if you want.

@arparthasarathi
Copy link
Author

The basic confirmable functionalities as such like sending mail, updating confirmable columns in the db are working perfectly. I do not want to interrupt the existing functionalities. But only need to delay sending the notification so that this awesome gem is fully utilised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants