Skip to content

Instantly share code, notes, and snippets.

@sibil
Last active October 2, 2020 15:13
Show Gist options
  • Save sibil/79eb8d35c5e967587493407a90afd5f0 to your computer and use it in GitHub Desktop.
Save sibil/79eb8d35c5e967587493407a90afd5f0 to your computer and use it in GitHub Desktop.
if userVerified(user):
sendSMS(user.mobile, "1234")
showOTPPage()
def sendSMS(recipient, message):
        message = "OTP: " + str(message)
        task = {"message": message, "number": recipient, "password": SMS_VENDOR_PASSWORD,
                "username": SMS_VENDOR_USERNAME, "sender": "MY_COMPANY"  }
        resp = requests.post(SMS_VENDOR_URL, json=task)
        if resp.status_code != 200:
            return False
        else:
            #print(resp.json())
            return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment