Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I resend invitation to a user using devise invitable?

I have devise invitable gem Hooked up in my app as well as devise.

Everything working fine. When I create new user, they are saved in database and mailer sends email an email address. User clicks on email, sets password and then is logged in.

But sometimes these users lose their email or rather can’t find it in their email inbox. I’d like to have a resend invite button on the users index page.

When user clicks resend, I want the invites user to get another email sent to them.

Had anyone successfully accomplished this with devise invitable? If so, can you share how?

like image 954
Wes Creations Avatar asked Oct 21 '25 13:10

Wes Creations


1 Answers

The gem adds a resend_invitation configuration parameter on your invitable-enabled model. From the docs:

resend_invitation: resend invitation if user with invited status is invited again. Enabled by default.

So, calling .invite! again on a record that's marked as invited will do the trick for you.

like image 73
rmlockerd Avatar answered Oct 23 '25 03:10

rmlockerd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!