def notify()

in use-cases/aws-lambda-redshift-event-driven-etl/LambdaRedshiftDataApiETL.py [0:0]


def notify(sns_topic_arn, subject, body):
    subject = ("".join(ch for ch in subject if unicodedata.category(ch)[0] != "C"))[0:99]
    body = str(body)
    sns_client = boto3.client('sns')
    response = sns_client.publish(
        TargetArn=sns_topic_arn,
        Message=json.dumps({'default': json.dumps("{}"),
                            'sms': subject,
                            'email': body}),
        Subject=subject,
        MessageStructure='json'
    )
    return "message sent"