Amazon web services 无法在AWS SES中更新模板

Amazon web services 无法在AWS SES中更新模板,amazon-web-services,aws-sdk,amazon-ses,Amazon Web Services,Aws Sdk,Amazon Ses,我通过AWS cli连接到AWS,我想更新我的一个SES模板的HTML。我已经逃过了引用。现在我得到了下一个错误: bash: !DOCTYPE: event not found 此时,我尝试运行下一个命令: aws ses update-template --template-name my-template --template '{"TemplateName":"my-template","SubjectPart":"Welcome to system!","TextPart":"Inv

我通过AWS cli连接到AWS,我想更新我的一个SES模板的HTML。我已经逃过了引用。现在我得到了下一个错误:

bash: !DOCTYPE: event not found
此时,我尝试运行下一个命令:

aws ses update-template --template-name my-template --template '{"TemplateName":"my-template","SubjectPart":"Welcome to system!","TextPart":"Invitation to login to system\n\nHi {{first-name}}. {{inviter}} wants to invite you to system. Follow the link below to continue.\n\n{{reset-password-link}}\n\nIf you're not interested, you can safely ignore this email.","HtmlPart":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" style=\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\">\n<head>\n<meta name=\"viewport\" content=\"width=device-width\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<title>Actionable emails e.g. reset password</title>\n\n\n<style type=\"text/css\">\nimg {\nmax-width: 100%;\n}\nbody {\n-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em;\n}\nbody {\nbackground-color: #f6f6f6;\n}\n@media only screen and (max-width: 640px) {\n  body {\n    padding: 0 !important;\n  }\n  h1 {\n    font-weight: 800 !important; margin: 20px 0 5px !important;\n  }\n  h2 {\n    font-weight: 800 !important; margin: 20px 0 5px !important;\n  }\n  h3 {\n    font-weight: 800 !important; margin: 20px 0 5px !important;\n  }\n  h4 {\n    font-weight: 800 !important; margin: 20px 0 5px !important;\n  }\n  h1 {\n    font-size: 22px !important;\n  }\n  h2 {\n    font-size: 18px !important;\n  }\n  h3 {\n    font-size: 16px !important;\n  }\n  .container {\n    padding: 0 !important; width: 100% !important;\n  }\n  .content {\n    padding: 0 !important;\n  }\n  .content-wrap {\n    padding: 10px !important;\n  }\n  .invoice {\n    width: 100% !important;\n  }\n}\n</style>\n</head>\n\n<body itemscope itemtype=\"http://schema.org/EmailMessage\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em; background-color: #f6f6f6; margin: 0;\" bgcolor=\"#f6f6f6\">\n\n<table class=\"body-wrap\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;\" bgcolor=\"#f6f6f6\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;\" valign=\"top\"></td>\n\t\t<td class=\"container\" width=\"600\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;\" valign=\"top\">\n\t\t\t<div class=\"content\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; max-width: 600px; display: block; margin: 0 auto; padding: 20px;\">\n\t\t\t\t<table class=\"main\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" itemprop=\"action\" itemscope itemtype=\"http://schema.org/ConfirmAction\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;\" bgcolor=\"#fff\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-wrap\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 20px;\" valign=\"top\">\n\t\t\t\t\t\t\t<meta itemprop=\"name\" content=\"Confirm Email\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\" /><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-block\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;\" valign=\"top\">\n\t\t\t\t\t\t\t\t\t\tPassword reset request.\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-block\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;\" valign=\"top\">\n\t\t\t\t\t\t\t\t\t\tHi {{first-name}}. {{inviter}} wants to invites you to system. Click on the link below to set up your password check out our platform.\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-block\" itemprop=\"handler\" itemscope itemtype=\"http://schema.org/HttpActionHandler\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;\" valign=\"top\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"{{reset-password-link}}\" class=\"btn-primary\" itemprop=\"url\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2em; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background-color: #348eda; margin: 0; border-color: #348eda; border-style: solid; border-width: 10px 20px;\">Set Password</a>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"content-block\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;\" valign=\"top\">\n                  If you're not interested, you can safely ignore this email.\n                </td>\n              </tr></table></td>\n\t\t\t\t\t</tr></table><div class=\"footer\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;\">\n\t\t\t\t\t<table width=\"100%\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><tr style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;\"><td class=\"aligncenter content-block\" style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0; padding: 0 0 20px;\" align=\"center\" valign=\"top\">from my Company</td>\n\t\t\t\t\t\t</tr></table></div></div>\n\t\t</td>\n\t\t<td style=\"font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;\" valign=\"top\"></td>\n\t</tr></table></body>\n</html>\n"}'
aws ses更新模板--template name my template--template'{“template name”:“我的模板”,“SubjectPart”:“欢迎使用系统!”,“TextPart”:“登录系统的邀请”\n\nHi{{first name}}。{{inviter}想邀请您使用系统。请按照下面的链接继续。\n\n{{{reset password link}\n\n如果您不感兴趣,可以安全地忽略此电子邮件。“,“HtmlPart”:“\n\n\n\n可处理的电子邮件,例如重置密码\n\n\n\nimg{\n最大宽度:100%;\n}\nbody{\n-webkit-font-smoothing:抗锯齿;-webkit文本大小调整:无;宽度:100%!重要;高度:100%;线条高度:1.6em;\n}\nbody{\nbackground color:\nF6F6F6;\n}”\n@media仅屏幕和(最大宽度:640px){\n正文{\n填充:0!重要;\n}\n h1{\n字体重量:800!重要;边距:20px 0 5px!重要;\n}\n h2{\n字体重量:800!重要;边距:20px 0 5px!重要;\n}\n h3{\n字体重量:800!重要;边距:20px 0 5px!重要;\n}\n h4{\n字体大小:800!重要;边距:20px 0 5px!重要;\n}\n h1{\n字体大小:22px!重要;\n}\n h2{\n字体大小:18px!重要;\n}\n h3{\n字体大小:16px!重要;\n}\n.容器{\n填充:0!重要;宽度:100%!重要;\n}\n}\n.内容{\n填充:0!重要;\n}\n}\n.内容包装\n\n}\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\n\n\n\\\\\n\n\\n\\\\\\\\\\\\n\\\\\n\\\\n\\\\\\n\\\\\\\{邀请者}想要邀请您访问系统。请单击下面的链接设置您的密码,并检查我们的平台。\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n如果您不感兴趣,可以安全地忽略我公司的这封电子邮件。\n\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t公司名称\n\t\t\t\t\t\t\n\t\t\n\t\t\n\t\n\t\n“}”

我一直在检查JSON内容,但我现在不知道它在哪里失败了。与其尝试通过AWS CLI执行此操作,因为它在处理特殊字符方面有困难,您可能希望通过编程语言进行尝试

例如,下面是一些Python代码:

导入boto3
ses_client=boto3.client(“ses”)
ses_client.update_模板(
模板={
'TemplateName':'my template',
“主题部分”:“欢迎使用系统!”,
“TextPart”:“邀请您登录系统\n\nHi{{first name}.{{inviter}}想邀请您登录系统。请按照下面的链接继续。\n\n{{reset password link}}\n\n如果您不感兴趣,可以安全地忽略此电子邮件。”,
“HtmlPart”:“html部分在此处”
}
)

当提供
HtmlPart
时,您不需要转义字符,因为它们位于由
引号包围的块中。

您可能希望通过编程语言尝试通过AWS CLI执行此操作,而AWS CLI在处理特殊字符时遇到困难

例如,下面是一些Python代码:

导入boto3
ses_client=boto3.client(“ses”)
ses_client.update_模板(
模板={
'TemplateName':'my template',
“主题部分”:“欢迎使用系统!”,
“TextPart”:“邀请您登录系统\n\nHi{{first name}.{{inviter}}想邀请您登录系统。请按照下面的链接继续。\n\n{{reset password link}}\n\n如果您不感兴趣,可以安全地忽略此电子邮件。”,
“HtmlPart”:“html部分在此处”
}
)

提供
HtmlPart
时,不需要转义字符,因为它们位于
包围的块中
quotes.

这可能是
@JohnRotenstein嗨!我怎么能比symbol更具观赏性?使用\?试着使用:
\@JohnRotensteinI仍然得到同样的效果。可能是
@JohnRotenstein嗨!我怎么能比symbol更具观赏性?使用\?试着使用:
\@JohnRotensteinI仍然得到同样的效果