Sharing Content by Emails
From ExtractValue Wiki
Brief Description
When a logged in user is browsing the site, and clicks to share content with someone else. We have a form that asks for email address(es) and custom message. Then, we email a message to the email(s) provided with a link to that page.
Behind the scenes, we are taking these emails and storing it into the invitee table. We're also creating a relationship between the user and this invitee in case the invitee decides to join later.
Backend Logic to Save Invitee From Emails
- Check to see if the email entered is already in users table
- If they are, do nothing for now... Perhaps later we can try to pair them as friends if they aren't already.
- Check to see if the email entered is already in invitee table
- If they are not, add the email address into invitee table with provider='manual', provider_type='email', and contact_name=
- Check to see if there is a user_invitee relationship
- If there isn't, create a user_invitee relationship
- Save information into the user_invitee_share table
- user_id, invitee_id, object_id, object_type, etc.
