def queue(self, message): frm = self.view.request.get('phone_number') if self.view.request.get('action') == ACTIONS[1]: frm = self.view.request.get('from') message.setdefault('event', 'send') message.setdefault('to', frm) outbox_message = EnvayaOutboxMessage(to=message['to'], message=message['message']) outbox_message.put() message['id'] = str(outbox_message.key.id()) self.append(message)
def queue(self, message): frm = self.view.request.get('phone_number') if self.view.request.get('action') == ACTIONS[1]: frm = self.view.request.get('from') message.setdefault('event', 'send') message.setdefault('to', frm) outbox_message = EnvayaOutboxMessage( to=message['to'], message=message['message'] ) outbox_message.put() message['id'] = str(outbox_message.key.id()) self.append(message)
def queue_unsent_messages(self): unsent_messages = EnvayaOutboxMessage.gql('WHERE send_status=:1', 'queued') for msg in unsent_messages.fetch(1000): msg = msg.toDICT msg['event'] = 'send' self.append(msg)
def queue_unsent_messages(self): unsent_messages = EnvayaOutboxMessage.gql( 'WHERE send_status=:1', 'queued' ) for msg in unsent_messages.fetch(1000): msg = msg.toDICT msg['event'] = 'send' self.append(msg)