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

Override send_password_change_notification to handle accepting invitation #718

Merged
merged 1 commit into from
Sep 27, 2017

Conversation

adzap
Copy link
Contributor

@adzap adzap commented Sep 26, 2017

During accepting an invitation we don't want a password change notification on the user's first sign in. This checks the value of accepting_invitation?.

This fixes #679

During accepting an invitation we don't want a password change
notification on the user's first sign in.
@scambra scambra merged commit 41fc567 into scambra:master Sep 27, 2017
@scambra
Copy link
Owner

scambra commented Sep 27, 2017

Thanks

@ACPK
Copy link

ACPK commented Oct 16, 2018

@scambra - I hit this issue when trying devise_invitable today. Is there a specific feature I need to enable as I currently have "send_password_change_notification" set to true. Hence, users that accepted an invitation got an email that their password was changed.

@scambra
Copy link
Owner

scambra commented Oct 17, 2018

You don't have to enable anything, it should work by default

You can override send_password_change_notification? in your model to debug if it's returning right value

      def send_password_change_notification?
        super.tap do |value|
          logger.info "DEBUG password change notification #{value.inspect}"
          logger.info "DEBUG accepting invitation? #{accepting_invitation.inspect}"
        end
      end

Expected log is:
DEBUG password change notification false
DEBUG accepting invitation? true

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

Successfully merging this pull request may close these issues.

Disable Password Changed notification when some one accept the invitation
3 participants