示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)