Saturday, March 25, 2006

It's their community, tell them about it.

Warning: Rough Notes Follow

Any user-focused social networking community should aim to keep its members informed about what’s happening in the community.

At the very least, the community should inform members of important events that relate to them.

By default all communication should be turned on to avoid confusing members with various signups. In each e-mail that is sent out, a member should be given the option to conveniently unsubscribe from receiving all future notifications of that type.

These are the notes for what we are doing at Adoppt.com. The "cleaner version" of these notes and how I actually did all this with Ruby on Rails and MySQL will be in my upcoming book, Pro Rails (the first few chapters of which are almost ready to be mailed out to beta readers who have kindly notified me about beta reading the book. Thanks).

On Adoppt.com, we would like to inform members about the following events.

  • [blog_comment_alert] When someone comments on their blog
      • Anyone can comment
      • When someone makes a comment to a member’s blog, we check to see the value of member.blog_comment_alerts
      • If it is set to 1
        • We alert them
      • If not
        • We don’t
  • [home_comment_alert] When someone comments on their homepage
    • Should anyone be able to comment on your home page? OR
    • Only friends should be allowed to comment on your home page?
    • member.home_comment_alerts = [0, 1]
    • When someone makes a comment on your home page
      • We check the value of member.home_comment_alerts
        • We send you an e-mail if its 1
        • We don’t send you an e-mail if it is 0
      • Unsubscribe: member.home_comment_alerts = 0
  • [forum_started_alert] When someone replies to a forum thread they started
    • member.forum_started_alerts = [0, 1]
    • When someone replies to a forum
    • We find the owner of the thread
    • If the owner of the thread has forum_started_alerts set to 1
      • We send the alert
    • Else
      • We don’t send the alert
  • [forum_participate_alert] When someone replies to a forum they participated in.
    • member.forum_participated_alerts = [0,1]
    • when someone makes a reply to a forum
    • we find all the people who have posted in that forum
    • for each member who participated in the forum
      • we check the value of forum_participated_alerts
      • if the value is 1
        • we send them an alert
      • else
        • we don’t send them an alert
  • [answer_alert] When someone answers a question they have asked
    • member.answer_alerts = [0, 1]
    • When someone answers a question we get the record of the member who asked the question
    • We check the value of answer_alerts
    • If it is 1
      • We alert them
    • If not
      • We don’t alert them
  • [message_alert] If someone sends them a message.
    • Member.message_alerts = [0,1]
    • When someone sends a member an internal message
    • We check to see the value of message_alerts
    • If it is 1
      • We alert them
    • If not
      • We don’t
  • [friend_blog_post_alert] When a friend of theirs makes a blog post.
    • new blog post
      • Joe makes a blog post.
      • OR
      • We need to find friends of Joe who have subscribed to Joe's blog

      • Either
      • we create a table friends_subscriptions
      • member_id
      • friend_id
      • subscribed
      • or we use the friends_members table
      • member_id
      • friend_id
    • At first thought, one may think of an ideal solution to just add another field to friends_members table to track whether a friend is subscribed to a blog. However, as we see in the next question, this solution is not really feasible in the real world.
    • Should only friends be allowed to subscribe to a blog?
      • CONS: blog readership limited only to people who you are friends with. Some other people may want to read your blog without being your friend. In real world, you can read anyone’s blog without having to be friends with them.
    • So the ideal solution for this example is to: [Joe wrote the post and Jill subscribes] [AUTO READER BY DEFAULT: we should add records here when you make a friend]
      • Create new table member_readerships
        • Member_id (Joe: wrote the blog post)
        • Reader_id (Jill: subscribed to Joe’s blog)
        • Readership_Type (friend_blog_post_alert)
      • Who’s subscribed? Who to send mails:
        • To get: member.readerships
          • SELECT * FROM member_readerships WHERE member_id=#{member.id} AND readership_type=’ friend_blog_post_alert’
      • Am I subscribed already: To check: subscribed=Readership.find_by_member_id_and_reader_id_and_readership_type(member.id, reader.id, ‘friend_blog_post_alert’)

      • To unsubscribe:
        • delete the record where reader_id=#{reader.id} AND member_id=#{member.id} AND readership_type=’ friend_blog_post_alert’
  • [friend_forum_start_alert] When a friend of theirs starts a forum thread
    • Must you be a friend?
      • No. Once again a person should be allowed to subscribe to a member’s forum posts even if they aren’t friends. By default we do auto readership where one member is automatically subscribed to all their friend’s forum posts.
      • In the table member_readerships
        • Member_id (Joe: started the forum thread)
        • Reader_id (Jill: subscribed to forum thread started by Joe)
        • Readership_Type (friend_forum_start_alert)
      • Who’s subscribed? Who to send mails:
        • To get: member.readerships
          • SELECT * FROM member_readerships WHERE member_id=#{member.id} AND readership_type=’friend_forum_start_alert’
      • Am I subscribed already: To check:
        subscribed=Readership.find_by_member_id_and_reader_id_and_readership_type(member.id, reader.id, ‘friend_forum_start_alert’)

      • To unsubscribe:
        • delete the record where reader_id=#{reader.id} AND member_id=#{member.id} AND readership_type=’ friend_forum_start_alert’
  • [friend_question_alert] When a friend of theirs asks a question
      • In the table member_readerships
        • Member_id (Joe: asking the question)
        • Reader_id (Jill: subscribed to questions asked by Joe)
        • Readership_Type (friend_question_alert)
      • Who’s subscribed? Who to send mails:
        • To get: member.readerships
          • SELECT * FROM member_readerships WHERE member_id=#{member.id} AND readership_type=’ friend_question_alert
      • Am I subscribed already: To check:
        subscribed=Readership.find_by_member_id_and_reader_id_and_readership_type(member.id, reader.id, friend_question_alert’)

      • To unsubscribe:
        • delete the record where reader_id=#{reader.id} AND member_id=#{member.id} AND readership_type=’ friend_question_alert
  • [blog_reader_alert] When someone subscribes to read their blog.
    • If someone wasn’t your friend and subscribed to your blog to read the posts, we send an email so you can know about it.
    • When we insert a record in member_readerships, we
      • Check the value of member.blog_reader_alerts and if it is non-zeo, then we send you (whose blog is being subscribed to / member.id) an e-mail.
    • If you don’t want to receive the blog_reader_alerts:
      • We set the member.blog_reader_alerts=0

  • Alertlist [acts_as_taggable]
    • A member can create an alert list:
      • id
      • Member_id
      • Name [for their convenience]
  • When someone asks a question, makes a blog post, posts a favorite
    • For each tag
      • We check whether someone has subscribed to be alerted for that tag:
      • For each record found
        • We send them a message
    • To unsubscribe: a member must delete the alert list.


Thanks for looking at the rough notes
--Frank

No comments: