Rails Devise: after_confirmation

后端 未结 8 1585
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 13:31

Is there a way to create a after_confirmation :do_something ?

The goal is to send an e-mail after the user confirms using Devise :confirmable

8条回答
  •  悲&欢浪女
    2020-12-05 13:50

    according to the Devise 3.5.9 source code, you can simply define a method on the Devise Resource model, e.g.:

      class User < ActiveRecord::Base
      ...
        def after_confirmation
           do_something
        end
      end
    

    See: Devise 3.5.9 Source Code: https://github.com/plataformatec/devise/blob/d293e00ef5f431129108c1cbebe942b32e6ba616/lib/devise/models/confirmable.rb

提交回复
热议问题