【问题标题】:How to send mailchimp templates with mandrill?如何使用 mandrill 发送 mailchimp 模板?
【发布时间】:2021-02-16 21:32:11
【问题描述】:

如何使用 mandrill 发送 mailchimp 模板?

我已经在 Mailchimp 中构建了一个模板并发送到 mandrill。

当我调用这个 API 时,它发送了一封没有模板的普通电子邮件。如何使用模板发送?

const response = await mailchimp.messages.send({
            template_name:"Test",
            message: {
                from_email: "noreply@mydomain.com",
                subject: "Hello world",
                text: "Welcome to Mailchimp Transactional!",
                to: [{
                    email: "myname@gmail.com",
                    type: "to"
                }]
            }
        });

【问题讨论】:

  • 我正在尝试使用 messages/send-template 发送消息,它显示“未找到模板”。你能帮忙吗
  • 你如何将它发送到山魈。我找不到发送到山魈的东西?

标签: node.js email mailchimp


【解决方案1】:

您必须使用 .messages.sendTemplate 而不是 .messages.send

【讨论】:

    【解决方案2】:

    我想通了,你必须添加一个空的内容字段

    const response = await mailchimp.messages.send({
                template_name:"Test",
                template_content: [],<--------ADD THIS
                message: {
                    from_email: "noreply@mydomain.com",
                    subject: "Hello world",
                    text: "Welcome to Mailchimp Transactional!",
                    to: [{
                        email: "myname@gmail.com",
                        type: "to"
                    }]
                }
            });
    

    【讨论】:

      猜你喜欢
      • 2013-06-07
      • 2014-10-26
      • 2015-09-15
      • 2013-06-22
      • 2015-08-30
      • 2017-06-15
      • 2013-09-06
      • 2013-11-26
      • 2016-12-24
      相关资源
      最近更新 更多