- Newest
- Most votes
- Most comments
Amazon SES supports sending email with content in any language. You're already using the correct charset (UTF-8) in your template, which should allow you to include special characters like é è ê à ù ë ï.
However, there might be an issue with how the content is being encoded or parsed. When providing content for ReplacementTemplateData and DefaultTemplateData, you should ensure that the content is JSON serialized and UTF-8 encoded.
Here's an example:
import boto3
import json
client = boto3.client('ses')
sender = 'sender@example.com'
template_name = 'template-name'
recipients_of_last_cluster_part = ['recipient@example.com']
replacement_template_data = {
'key': 'value'
}
response = client.send_bulk_templated_email(
Source=sender,
ReturnPath=sender,
Template=template_name,
Destinations=[
{
'Destination': {
'BccAddresses': recipients_of_last_cluster_part
},
'ReplacementTemplateData': json.dumps(replacement_template_data, ensure_ascii=False)
},
],
DefaultTemplateData=json.dumps(replacement_template_data, ensure_ascii=False)
)
In the code above, json.dumps(replacement_template_data, ensure_ascii=False) is used to ensure that non-ASCII characters are preserved.
If the issue still persists, the problem might lie in the creation of the template itself. It's not clear from your example how you are creating the template. If you're creating the template manually (i.e., not using the SES API), it might be an issue with the encoding of the file you're using. Make sure that the file itself is saved with UTF-8 encoding.
Also, keep in mind that the send_bulk_templated_email function sends emails asynchronously, meaning the function will return a success response before the emails have been sent. You can check for failures in the returned response object. Specifically, you would want to check the Failed field of the response object, which will contain an array of BulkEmailDestinationStatus objects that correspond to the destinations that you specified in the Destinations parameter. If any emails failed to send, the Status field of the corresponding BulkEmailDestinationStatus object will contain Failed, and the Error field will contain information about what went wrong.
answered 3 years ago
Relevant content
asked 3 years ago
asked 4 years ago
- AWS OFFICIALUpdated a year ago

The suggestion with ensure_ascii=False does not solve my problem.
I do not see how it could come from the template creation since I am simply using the AWS CLI to create and update it with the following command and JSON file:
aws ses update-template --cli-input-json file://example-template.json
{ "Template": { "TemplateName": "example-template", "SubjectPart": "example subject", "HtmlPart": "<html><head><meta charset="UTF-8"</head><body> é è ê à ù ë ï </body>", "TextPart": "é è ê à ù ë ï" } }