gpt4 book ai didi

amazon-web-services - 使用 AWS SES 中的模板发送带有附件的电子邮件

转载 作者:行者123 更新时间:2023-12-04 17:43:44 30 4
gpt4 key购买 nike

我正在尝试使用电子邮件模板来个性化我发送的电子邮件,方法是通过 JSON 字符串将数据传递给已创建的模板。尽管我可以通过附加文件来发送原始电子邮件,但我想要一种方法,通过它我可以在使用 SES 中的电子邮件模板的同时在电子邮件中发送电子邮件附件。

最佳答案

根据我的 RND,无法使用 SES 模板和附件发送电子邮件,但是我们可以做这样的事情。

  • 使用下面的代码从 SES 中获取模板,然后我们可以替换 token ,然后我们在 中使用这些SendRawEmail 电子邮件连同附件。
     AmazonSimpleEmailService emailSendClient = 
    AmazonSimpleEmailServiceClient.builder()
    .withRegion(Regions.AP_SOUTH_1).build();
    String templateName = "MyTemplate";
    GetTemplateRequest getTemplateRequest = new GetTemplateRequest();
    getTemplateRequest.setTemplateName(templateName);
    GetTemplateResult temp = emailSendClient.getTemplate(getTemplateRequest);
    String htmlpart = temp.getTemplate().getHtmlPart();
  • 关于amazon-web-services - 使用 AWS SES 中的模板发送带有附件的电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53207054/

    30 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com