管理者がdevise_invitableで新しいユーザーを招待するアプリがあります。これはうまくいきますが、物事を分割したいと思います。最初にユーザーを作成し、後でそれらを招待できるようにしたいと考えています。これらのアクションを分割するにはどうすればよいですか?
1 に答える
1
を使用して、実際の招待状の送信をスキップするskip_invitation
オプションを使用できます。invite!
User.invite!(:email => "new_user@example.com", :name => "John Doe", :skip_invitation => true)
# the record will be created, but the invitation email will not be sent
その後、次の方法で招待状を送信できます。
user = User.find(42)
user.deliver_invitation
于 2015-05-22T14:00:38.507 に答える