in lambda/classify-emails-lambda/lambda_function.py [0:0]
def send_user_email(email, intent):
logger.info("Sending email to the user : [{}]".format(email))
template_data = get_template_data(email, intent)
if temaplte_data is not None:
response = ses_client.send_templated_email(
Source=source_email,
Destination={
'ToAddresses': [
email['to'],
]
},
Template=intent,
TemplateData=template_data
)
logger.info("Sent the email. Response is [{}]".format(response))
else:
send_to_human_workflow_topic(email)