I would like to build a form on my website where users, who are already registered, could invite new users via e-mail to sign up for this website. The user who sent the invitation and the user who accepted the invitation (and signed up) are then connected through a “friendship” relationship.
I would like to send the invitations via the ActionMailer.
My problem is: How do I “link” the email to the friendship-relationship. One way is probably to create a unique sender_id, which points to the user and which will be used as a link in the email.
Is there another possibility?
Thanks for your help!
In the link create an argument, where you can pass an ID that could identify your relationship.
Something like: http://example.com/invite?abcd
Than in you controller you can treat the relationship.
Other option is to use Devise Invitable