labpack/messaging/twilio.py
def send_message(self, phone_number, message_text):

        ''' send an SMS from the Twilio account to phone number

        :param phone_number: string with phone number with country and area code
        :param message_text: string with message text
        :return: dictionary with details of response

        {
            'direction': 'outbound-api',
            'to': '+18001234567',
            'status': 'queued',
            'dt': 1479603651.0,
            'body': 'good times',
            'error_code': None,
            'from': '+19001234567'
        }

        '''

        response = self.client.messages.save(
            to=phone_number,
            from_=self.twilio_phone,
            body=message_text
        )

        keys = ['body', 'status', 'error_code', 'direction', 'date_updated', 'to', 'from_']
        response_details = {}
        import re
        builtin_pattern = re.compile('^_')
        for method in dir(response):
            if not builtin_pattern.findall(method):
                if method == 'date_updated':
                    from labpack.records.time import labDT
                    python_dt = getattr(response, method)
                    from tzlocal import get_localzone
                    python_dt = python_dt.replace(tzinfo=get_localzone())
                    response_details[method] = labDT.fromPython(python_dt).epoch()
                elif method in keys:
                    response_details[method] = getattr(response, method)

        return response_details
 send an SMS from the Twilio account to phone number

        :param phone_number: string with phone number with country and area code
        :param message_text: string with message text
        :return: dictionary with details of response

        {
            'direction': 'outbound-api',
            'to': '+18001234567',
            'status': 'queued',
            'dt': 1479603651.0,
            'body': 'good times',
            'error_code': None,
            'from': '+19001234567'
        }

        
send an SMS from the Twilio account to phone number
send an SMS from the Twilio account to phone number
def send_message(self, phone_number, message_text):
        response = self.client.messages.save(
            to=phone_number,
            from_=self.twilio_phone,
            body=message_text
        )
        keys = ['body', 'status', 'error_code', 'direction', 'date_updated', 'to', 'from_']
        response_details = {}
        import re
        builtin_pattern = re.compile('^_')
        for method in dir(response):
            if not builtin_pattern.findall(method):
                if method == 'date_updated':
                    from labpack.records.time import labDT
                    python_dt = getattr(response, method)
                    from tzlocal import get_localzone
                    python_dt = python_dt.replace(tzinfo=get_localzone())
                    response_details[method] = labDT.fromPython(python_dt).epoch()
                elif method in keys:
                    response_details[method] = getattr(response, method)
        return response_details
def send_message ( self , phone_number , message_text ) : response = self . client . messages . save ( to = phone_number , from_ = self . twilio_phone , body = message_text ) keys = [ 'body' , 'status' , 'error_code' , 'direction' , 'date_updated' , 'to' , 'from_' ] response_details = { } import re builtin_pattern = re . compile ( '^_' ) for method in dir ( response ) : if not builtin_pattern . findall ( method ) : if method == 'date_updated' : from labpack . records . time import labDT python_dt = getattr ( response , method ) from tzlocal import get_localzone python_dt = python_dt . replace ( tzinfo = get_localzone ( ) ) response_details [ method ] = labDT . fromPython ( python_dt ) . epoch ( ) elif method in keys : response_details [ method ] = getattr ( response , method ) return response_details
send an SMS from the Twilio account to phone number
send an SMS from the Twilio account to phone number
''' send an SMS from the Twilio account to phone number

        :param phone_number: string with phone number with country and area code
        :param message_text: string with message text
        :return: dictionary with details of response

        {
            'direction': 'outbound-api',
            'to': '+18001234567',
            'status': 'queued',
            'dt': 1479603651.0,
            'body': 'good times',
            'error_code': None,
            'from': '+19001234567'
        }

        '''
None
self
phone_number
string with phone number with country and area code
string with phone number with country and area code
message_text
string with message text
string with message text