def accept_and_notify(self, notify=True): self.accept() # notify user that friend request accepted # notify friends that connection has been made if not notify: return True ctx = { 'actor': self.to_user.get_profile(), 'actee': self.from_user.get_profile(), 'actor_child': self.to_child, 'actee_child': self.from_child } create_message(self.to_user, self.from_user, 'playlist_request_confirmed', ctx, category='Message', respond=False) email_pref = get_message_preference(self.from_user, 'friend_related') if email_pref: send_email(self.from_user.email, 'playlist_request_confirmed', ctx)
def save_and_notify(self, notify=True): self.save() # notify user that they have a friend request if not notify: return True ctx = { 'actor': self.from_user.get_profile(), 'actee': self.to_user.get_profile(), 'actor_child': self.from_child, 'actee_child': self.to_child, 'message': self.message } create_message(self.from_user, self.to_user, 'playlist_request_received', ctx, category='Friend Request', associated_item=self.id) email_pref = get_message_preference(self.to_user, 'friend_related') if email_pref: send_email(self.to_user.email, 'playlist_request_received', ctx)
def invite_invitee(self, message_type): ctx = { 'actor': self.playdate.organizer.get_profile(), 'actor_child': self.organizer_child, 'actee':self.to_user.get_profile(), 'actee_child':self.to_child, 'message':self.playdate.details, 'playdate':self.playdate, 'playdate_url':self.playdate_url, } create_message(self.playdate.organizer, self.to_user, message_type, ctx, category='Playdate Request', associated_item=self.playdate.id) send_invite_email(self.to_user.email, self.playdate.invite_design, ctx)
def notify_invitee(self, notify, ctx, message_type): if not notify: return True ctx.update({ 'this_invite':self, }) create_message(self.playdate.organizer, self.to_user, message_type, ctx, respond=False) email_pref = get_message_preference(self.to_user, 'playdate_attendee_related') if email_pref: send_email(self.to_user.email, message_type, ctx)
def notify_organizer(self, notify, message_type): if not notify: return True ctx = { 'actor':self.to_user.get_profile(), 'actor_child':self.to_child, 'actee': self.playdate.organizer.get_profile(), 'actee_child': self.organizer_child, 'response':self.response, 'playdate':self.playdate, 'active_invite':self, } create_message(self.to_user, self.playdate.organizer, message_type, ctx, respond=False) email_pref = get_message_preference(self.playdate.organizer, 'playdate_host_related') if email_pref: send_email(self.playdate.organizer.email, message_type, ctx)
def accept_and_notify(self, notify=True): self.accept() # notify user that friend request accepted # notify friends that connection has been made if not notify: return True ctx = { 'actor': self.to_user.get_profile(), 'actee': self.from_user.get_profile(), 'actor_child':self.to_child, 'actee_child':self.from_child } create_message(self.to_user, self.from_user, 'playlist_request_confirmed', ctx, category='Message', respond=False ) email_pref = get_message_preference(self.from_user, 'friend_related') if email_pref: send_email(self.from_user.email, 'playlist_request_confirmed', ctx)
def save_and_notify(self, notify=True): self.save() # notify user that they have a friend request if not notify: return True ctx = { 'actor': self.from_user.get_profile(), 'actee': self.to_user.get_profile(), 'actor_child':self.from_child, 'actee_child':self.to_child, 'message':self.message } create_message(self.from_user, self.to_user, 'playlist_request_received', ctx, category='Friend Request', associated_item=self.id ) email_pref = get_message_preference(self.to_user, 'friend_related') if email_pref: send_email(self.to_user.email, 'playlist_request_received', ctx)