Skip to content

Instantly share code, notes, and snippets.

@kayalshri
Created March 15, 2019 08:55
Show Gist options
  • Save kayalshri/5e826e08041bd0bbe89c1af76620d40e to your computer and use it in GitHub Desktop.
Save kayalshri/5e826e08041bd0bbe89c1af76620d40e to your computer and use it in GitHub Desktop.
SMS Send via AWS
def sendSMS(clientId,msg):
cmd = """wget "https://nxyz.com/LATEST/001?module=profile&clientId=%s" -O clientprofile.json""" % clientId
os.system(cmd)
dataDict = None
with open('clientprofile.json') as bIN:
dataDict = json.load(bIN)
mobile = dataDict.get('mobile')
mstatus = dataDict.get('phoneStatus')
## Validate Mobile Status
if mstatus == 0:
print(mobile,mstatus)
## Execute AWS SMS
cmd = """aws sns publish --phone-number +%s --message "%s" """ % (mobile,msg)
print(cmd)
os.system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment