def post(self): payload = json.loads(self.request.body) user_id = payload['user_id'] reference_dict = payload['reference_dict'] message = feedback_services.get_message(reference_dict['thread_id'], reference_dict['message_id']) exploration = exp_fetchers.get_exploration_by_id( reference_dict['entity_id']) thread = feedback_services.get_thread(reference_dict['thread_id']) model = email_models.GeneralFeedbackEmailReplyToIdModel.get( user_id, reference_dict['thread_id']) reply_to_id = model.reply_to_id subject = 'New Oppia message in "%s"' % thread.subject email_manager.send_instant_feedback_message_email( user_id, message.author_id, message.text, subject, exploration.title, reference_dict['entity_id'], thread.subject, reply_to_id=reply_to_id) self.render_json({})
def post(self): payload = json.loads(self.request.body) user_id = payload['user_id'] reference_dict = payload['reference_dict'] message = feedback_services.get_message(reference_dict['thread_id'], reference_dict['message_id']) exploration = exp_fetchers.get_exploration_by_id( reference_dict['entity_id']) thread = feedback_services.get_thread(reference_dict['thread_id']) feedback_thread_reply_info = ( email_services.get_feedback_thread_reply_info_by_user_and_thread( user_id, reference_dict['thread_id'])) if feedback_thread_reply_info is None: raise self.InvalidInputException( 'Feedback thread for current user and thread_id does not exist' ) subject = 'New Oppia message in "%s"' % thread.subject email_manager.send_instant_feedback_message_email( user_id, message.author_id, message.text, subject, exploration.title, reference_dict['entity_id'], thread.subject, reply_to_id=feedback_thread_reply_info.reply_to_id) self.render_json({})
def post(self): payload = json.loads(self.request.body) user_id = payload['user_id'] reference_dict = payload['reference_dict'] message = feedback_services.get_message( reference_dict['exploration_id'], reference_dict['thread_id'], reference_dict['message_id']) exploration = exp_services.get_exploration_by_id( reference_dict['exploration_id']) thread = feedback_services.get_thread( reference_dict['exploration_id'], reference_dict['thread_id']) subject = 'New Oppia message in "%s"' % thread.subject email_manager.send_instant_feedback_message_email( user_id, message.author_id, message.text, subject, exploration.title, reference_dict['exploration_id'], thread.subject)
def post(self): payload = json.loads(self.request.body) user_id = payload['user_id'] reference_dict = payload['reference_dict'] old_status = payload['old_status'] new_status = payload['new_status'] message = feedback_services.get_message( reference_dict['thread_id'], reference_dict['message_id']) exploration = exp_fetchers.get_exploration_by_id( reference_dict['entity_id']) thread = feedback_services.get_thread(reference_dict['thread_id']) text = 'changed status from %s to %s' % (old_status, new_status) subject = 'Oppia thread status change: "%s"' % thread.subject email_manager.send_instant_feedback_message_email( user_id, message.author_id, text, subject, exploration.title, reference_dict['entity_id'], thread.subject)
def post(self): payload = json.loads(self.request.body) user_id = payload['user_id'] reference_dict = payload['reference_dict'] old_status = payload['old_status'] new_status = payload['new_status'] message = feedback_services.get_message( reference_dict['exploration_id'], reference_dict['thread_id'], reference_dict['message_id']) exploration = exp_services.get_exploration_by_id( reference_dict['exploration_id']) thread = feedback_services.get_thread( reference_dict['exploration_id'], reference_dict['thread_id']) text = 'changed status from %s to %s' % (old_status, new_status) subject = 'Oppia thread status change: "%s"' % thread.subject email_manager.send_instant_feedback_message_email( user_id, message.author_id, text, subject, exploration.title, reference_dict['exploration_id'], thread.subject)