aws/lambda_function.py
def publish_text_message(message, phone_number):
    """
    Publishes a text message directly to a phone number without need for a
    subscription.

    :param phone_number: The phone number that receives the message. This must be
                             in E.164 format. For example, a United States phone
                             number might be +12065550101.
    :param message: The message to send.
    :return: The ID of the message.
     """
    try:
        response = boto3.resource('sns').meta.client.publish(PhoneNumber=phone_number, Message=message)
        message_id = response['MessageId']
        print("Published message to " + phone_number + ".")
        logger.info("Published message to %s.", phone_number)
    except ClientError:
        logger.exception("Couldn't publish message to %s.", phone_number)
        raise
    else:
        return message_id

    Publishes a text message directly to a phone number without need for a
    subscription.

    :param phone_number: The phone number that receives the message. This must be
                             in E.164 format. For example, a United States phone
                             number might be +12065550101.
    :param message: The message to send.
    :return: The ID of the message.
     
Publishes a text message directly to a phone number without need for a
subscription.
Publishes a text message directly to a phone number without need for a subscription .
def publish_text_message(message, phone_number):
    try:
        response = boto3.resource('sns').meta.client.publish(PhoneNumber=phone_number, Message=message)
        message_id = response['MessageId']
        print("Published message to " + phone_number + ".")
        logger.info("Published message to %s.", phone_number)
    except ClientError:
        logger.exception("Couldn't publish message to %s.", phone_number)
        raise
    else:
        return message_id
def publish_text_message ( message , phone_number ) : try : response = boto3 . resource ( 'sns' ) . meta . client . publish ( PhoneNumber = phone_number , Message = message ) message_id = response [ 'MessageId' ] print ( "Published message to " + phone_number + "." ) logger . info ( "Published message to %s." , phone_number ) except ClientError : logger . exception ( "Couldn't publish message to %s." , phone_number ) raise else : return message_id
Publishes a text message directly to a phone number without need for a
subscription.
Publishes a text message directly to a phone number without need for a subscription .
"""
    Publishes a text message directly to a phone number without need for a
    subscription.

    :param phone_number: The phone number that receives the message. This must be
                             in E.164 format. For example, a United States phone
                             number might be +12065550101.
    :param message: The message to send.
    :return: The ID of the message.
     """
The ID of the message.
The ID of the message .
message
The message to send.
The message to send .
phone_number
The phone number that receives the message. This must be
in E.164 format. For example, a United States phone
number might be +12065550101.
The phone number that receives the message . This must be in E . 164 format . For example a United States phone number might be + 12065550101 .