module JamRuby
  class InvitedUserObserver < ActiveRecord::Observer

    observe JamRuby::InvitedUser

    def after_create(invited_user)
      if invited_user.sender.nil?
        InvitedUserMailer.welcome_betauser(invited_user).deliver
      else
        InvitedUserMailer.friend_invitation(invited_user).deliver
      end
    end
  end
end