scambra / devise_invitable

An invitation strategy for devise
MIT License
2.66k stars 553 forks source link

How to prevent to send a confirmation email when email field is updated ? #903

Closed adrys-lab closed 10 months ago

adrys-lab commented 10 months ago

In our application we are sending a confirmation email (OLD email, saying email has changed, NEW email confirm your email) when a user updates his email.

Now this is handled by another system and we want the legacy service stop sending such notification (NEW email confirm your email),

is there a standalone configuration to prevent that ?

Could it be this option ?

config.reconfirmable = true

We want ONLY avoid sending emails when email update (meaning from xx@xx.com to yy@yy.com), but keep sending emails on NEW SIGN IN.

i would like to find a proper configuration that allows us to do so, instead of hijacking it like the snipped code below:

  def confirmation_instructions(record, token, opts = {})
    return if opts[:action] == "email_update"

    XXXX
  end
scambra commented 10 months ago

confirmable is a Devise module, not related to invitable, ask in https://github.com/heartcombo/devise