Sending sms notification to multiple phone number using SNS with boto3

送分小仙女□ 提交于 2021-01-07 06:33:41

问题


I am trying to send an event-driven notification through SMS using aws SNS.

I am trying to write a script to send a message to a single number first. Here is my below code for that

import json
import boto3

def lambda_handler(event, context):
    client = boto3.client("sns")
    response = client.publish(
    PhoneNumber="+91 xxxxxxxxxx",
    Message="Hello World!"
    )
    print (response)
    
    # TODO implement
    return {
        'statusCode': 200,
        'body': json.dumps('Hello from Lambda!')
    }
  

The thing here is I am not getting any message from this. Could anyone help me out in achieving this use case of mine?

来源:https://stackoverflow.com/questions/65247453/sending-sms-notification-to-multiple-phone-number-using-sns-with-boto3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!