Простой почтовый сервис Пользовательский шаблон AWS
Can anyone tell me what syntax your are using to send a customized email
template to a verified email address using a Python script?
I can easily send the non-customized AWS supplied template that AWS SES
provides from a Python script like this:
import os
import boto3
print("** SEND AWS SUPPLIED TEMPLATE ** ")
sendTo = 'myemail@gmail.com'
ses = boto3.client('ses')
response = ses.verify_email_identity(EmailAddress = sendTo)
print(response)
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ses.html#SES.Client.verify_email_identity.html
The above link explains how to use "verify_email_identity()" which works
well.
But the same link instructs how to use "send_custom_verification_email()"
It requires that the customized template already exist. Mine was created
from a python shell as follows:
>>> import boto3
>>> ses = boto3.client('ses')
>>> response = ses.create_template(Template = {'TemplateName' : 'test1','SubjectPart':'Greetings','TextPart':'hello world','HtmlPart':'<html><head></head><body>Welcome</body>'})
>>> print(response)
The above creates my customized "test1" template and it can be viewed from
the SES service under the "Email Templates" menu. So it does exist.
Now I attempt to send this "test1" custom template using this python script:
import os
import boto3
print("** SEND AWS CUSTOMIZED TEMPLATE ** ")
sendTo = 'myemail@gmail.com'
client = boto3.client('ses')
response = client.send_custom_verification_email(EmailAddress = sendTo, TemplateName = 'test1')
print(response)
Я получаю сообщение об ошибке: CustomVerificationEmailTemplateDoesNotExistException
botocore.errorfactory.CustomVerificationEmailTemplateDoesNotExistException: ошибка произошла:(CustomVerificationEmailTemplateDoesNotExist), когда
вызывает операцию SendCustomVerificationEmail: Неизвестно
Есть идеи, почему он считает, что пользовательский шаблон не существует?Спасибо, Кенни