【问题标题】:How to migrate AWS SES email templates between regions?如何在区域之间迁移 AWS SES 电子邮件模板?
【发布时间】:2021-12-13 15:28:58
【问题描述】:

我在一个区域中有多个 (30 多个) AWS SES 电子邮件模板,最近我不得不为另一个客户使用另一个区域,我想将我的所有模板迁移到新区域。 CLI 没有太大帮助,因为您只能列出模板的名称而不是内容。

【问题讨论】:

    标签: amazon-web-services email templates amazon-ses


    【解决方案1】:

    GetTemplate Command “为您指定的模板显示模板对象(包括主题行、HTML 部分和文本部分)。”

    Python SDK 示例:

    session = boto3.Session(region_name='us-east-1')
    ses = session.client('ses')
    
    # create some dummy templates
    for i in range(3):
      ses.create_template(Template={
        "TemplateName": f'Template{i}',
        'HtmlPart': '<body></body>',
        'SubjectPart': 'hello',
        'TextPart': 'hello'
      })
    
    # download them
    templates = [ses.get_template(TemplateName=m['Name']) for m in ses.list_templates()['TemplatesMetadata']]
    
    print(templates[0]['Template'])
    # --> {'TemplateName': 'Template2', 'SubjectPart': 'hello', 'TextPart': 'hello', 'HtmlPart': '<body></body>'}
    

    【讨论】:

      猜你喜欢
      • 2020-12-21
      • 2017-01-30
      • 2020-09-16
      • 1970-01-01
      • 2020-04-07
      • 2020-10-04
      • 1970-01-01
      • 2020-01-16
      • 2020-10-19
      相关资源
      最近更新 更多