Beispiel #1
0
def manually_send_message():
    client = TwilioRestClient(account_sid, auth_token)
    # - Note: The from_ number must be a valid Twilio phone number. The to number can be any outgoing number.
    # to = "+12316851234"
    # from_ = "+10000000000"
    phone_number = 'some number'
    to = phone_number
    from_ = twilio_number
    body = CompanyContacts.check_in(from_)
    client.messages.create(to, from_, body)
Beispiel #2
0
def manually_send_message():
    client = TwilioRestClient(account_sid, auth_token)
    # - Note: The from_ number must be a valid Twilio phone number. The to number can be any outgoing number.
    # to = "+12316851234"
    # from_ = "+10000000000"
    phone_number = 'some number'
    to = phone_number
    from_ = twilio_number
    body = CompanyContacts.check_in(from_)
    client.messages.create(to, from_, body)
Beispiel #3
0
def get_individual(identifier):
    contact = CompanyContacts.get_contact(primary_phone=identifier)

    if identifier in contact:
        individual = {"first_name": contact[identifier]["first_name"],
                      "last_name": contact[identifier]["last_name"],
                      "primary_phone": identifier}
    else:
        individual = {"first_name": "Unknown",
                      "last_name": "Unknown",
                      "primary_phone": identifier}

    return individual
Beispiel #4
0
def get_individual(identifier):
    contact = CompanyContacts.get_contact(primary_phone=identifier)

    if identifier in contact:
        individual = {
            "first_name": contact[identifier]["first_name"],
            "last_name": contact[identifier]["last_name"],
            "primary_phone": identifier
        }
    else:
        individual = {
            "first_name": "Unknown",
            "last_name": "Unknown",
            "primary_phone": identifier
        }

    return individual
Beispiel #5
0
def sms_response():
    resp = twilio.twiml.Response()
    from_ = twilio_number
    body = CompanyContacts.check_in(from_)
    resp.message(body)
    return str(resp)
Beispiel #6
0
def sms_response():
    resp = twilio.twiml.Response()
    from_ = twilio_number
    body = CompanyContacts.check_in(from_)
    resp.message(body)
    return str(resp)
Beispiel #7
0
def register_contact(first_name, last_name, primary_phone):
    contact = CompanyContacts(first_name, last_name, primary_phone)
    print("contact: ", contact.first_name)
    store_contact(contact)
    return contact