sorcery icon indicating copy to clipboard operation
sorcery copied to clipboard

Make possible to send a new activation email from a controller

Open nicolas-brousse opened this issue 5 years ago • 2 comments

Please complete all sections.

Configuration

  • Sorcery Version: 0.25.0
  • Ruby Version: 2.7.2
  • Framework: Rails 6.0
  • Platform: macos

Expected Behavior

I you like to send a new activation email like is it currently possible for reset password.

Actual Behavior

Activation email is a private method, so it is no possible to call it from outside. And it doesn't include protection condition like reset password do (time betweens to emails are sent)

If you are agree to implement this in Sorcery, I'll open a PR.

nicolas-brousse avatar Nov 19 '20 16:11 nicolas-brousse

Hello @nicolas-brousse , to call activation e-mail from outside you can do something like that in your model:

  # Activation email (user.rb)
  def send_invite_email!
    send_activation_needed_email!
  end

The protection inclusion i think it's such a great idea.

I'm also a little confused on the reasoning behind locking the emails behind protected/private. It's always been a weird inconvenience having to abstract the call. I'll look into this for the v1 rework, and if there's no obvious reasons for it, make those methods publicly accessible.

joshbuker avatar Feb 19 '21 02:02 joshbuker