def send_sms(number, text, sender, recipient=None, parent=None): """Send sms using the vertex sms gateway.""" from ututi.model import SMS msg = SMS(recipient_number=number, message_text=text, sender=sender, recipient=recipient) if parent: msg.outgoing_group_message = parent meta.Session.add(msg) log.debug("%s -> %r" % (number, text)) hold_emails = asbool(config.get('hold_emails', False)) if hold_emails: sms_queue.append((msg.recipient_number, msg.message_text))
def status(self): sms_id = request.params.get('id') sms = SMS.get(sms_id) sms.delivery_status = request.params.get('status') sms.delivered = datetime.utcnow() meta.Session.commit()