amazon-web-services - SES 模板/电子邮件无法呈现日文文本
问题描述
我创建了 SES 模板并从 aws-cli 渲染它,您可以看到非英语文本被替换为“?”,无论是纯文本版本还是 HTML 版本。如何解决这个问题?PS:我也通过发送电子邮件检查了它。
以下是我的 TestMainTemplate.json 文件
{
"Template": {
"TemplateName": "TestTemplate01",
"SubjectPart": "こんにちは {{name}}!",
"HtmlPart": "<h1>こんにちは {{name}}さん</h1><p>あなたの好きなAWSサービスは{{favoriteservice}}ですね。</p>",
"TextPart": "前略 {{name}}さん\r\nあなたの好きなAWSサービスは{{favoriteservice}}ですね。\r\n草々"
}
}
从 cli 将模板上传到 aws SES 的命令:
aws ses create-template --cli-input-json file://TestMainTemplate.json --region us-east-1
渲染模板的命令:
aws ses test-render-template --template-name TestTemplate01 --template-data '{ "name": "大栗" , "favoriteservice": "SES" }' --region us-east-1
输出:
Date: 2018-09-14T03:27:46.913Z
Message-ID: <5990...........ec2-user@ip-......ec2.internal>
Subject: ????? ??!
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_106793_202759574.1536895666913"
Content-Transfer-Encoding: quoted-printable
------=_Part_106793_202759574.1536895666913
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
?? ????
???????AWS?????SES????
??
------=_Part_106793_202759574.1536895666913
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
<h1>????? ????</h1><p>???????AWS?????SES????</p>
------=_Part_106793_202759574.1536895666913--
解决方案
我对德语 ä ö ü 有疑问。我将上传的 json 文件的编码从 UTF-8 更改为 ANSI,一切都很好。
上传模板并通过 AWS CLI 发送 get-template 命令后,我已经可以看到乱码。将编码更改为 ANSI 为我完成了这项工作。
哦,我不必为此更改控制台编码!
推荐阅读
- zoho - 您必须对出口交易征收零税率税
- microsoft-graph-api - 验证 SMTP 地址是否与邮箱关联?
- r - R:绘制小时数据
- php - 限制每个 CPT 的搜索结果(wordpress)
- sorting - Elasticsearch 按文本长度排序
- wordpress - 如何在我的主题中覆盖 woocommerce 相关插件的文件?
- html - 如何仅使用 HTML 和 CSS 制作剥离框阴影?
- android - 如何处理片段中 ViewPager2 和水平 recyclerView 的平滑滚动?
- swiftui - 为什么即使列表已正确更新,上下文菜单仍显示旧状态?
- mysql - mySQL Select All where date is less than 1 day from max date in data