Search code examples
pythonamazon-web-servicesaws-pinpoint

AWS send email with template in pinpoint api


Any example of how to send an email with a pinpoint api template in AWS for Python?

I am trying the example https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/pinpoint-email.html#PinpointEmail.Client.send_email but I am not successful


Solution

  • Finally i use

    client      =   boto3.client('pinpoint-email', region_name=AWS_REGION)
    response = client.send_email(
                FromEmailAddress='SENDER',
                Destination={
                    'ToAddresses': ['TOADDRESSES']
                },
                Content={
                    'Template': {
                        'TemplateArn': TEMPLATE_ARN,
                        "TemplateData": json.dumps(TEMPLATE_DATA)
                    }
                }
            )