【问题标题】:Impossible to define dynamic content (mc:edit) when creating a Campaign from a template with V2 API使用 V2 API 从模板创建活动时无法定义动态内容 (mc:edit)
【发布时间】:2023-03-10 10:52:01
【问题描述】:

我正在使用 Mailchimp API v2,带有适当的 php 包装器。
需求很简单:

1 - 从现有模板创建广告系列
2 - 发送活动

我的问题是我无法从该 API 的部分(称为 mc:edit)中创建任何内容,尽管根据文档,这是可能的。

在 Mailchimp 帐户上,这是模板的一部分

<table border="0" cellpadding="10" cellspacing="0" width="600" id="templateBody">
    <tr>
            <td valign="top" class="bodyContent">

                    <!-- // Begin Module: Standard Content \\ -->
                    <table border="0" cellpadding="10" cellspacing="0" width="100%">
                            <tr>
                                    <td valign="top">
                                            <div mc:edit="content_tdm_body></div>
                                    </td>
                            </tr>
                    </table>
                    <!-- // End Module: Standard Content \\ -->

            </td>
    </tr>

如您所见,我的可编辑内容密钥是content_tdm_body

这是我使用的 php 代码:

$cid = $api->campaignCreate('regular', 

                             array('list_id' => "xxx", 
                                   'subject' => "A campagin test",
                                   'from_email' => "x@y.com",
                                   'from_name' => "TDM",
                                   'template_id' => "xxx"),

                             array('sections' => array('content_tdm_body' => "TEST")));

$campSendStatus = $api->campaignSendNow($cid);

显然,campaing 已创建,邮件已发送,但内容肯定是空的。

有人遇到过这种问题吗?我错过了什么?

【问题讨论】:

  • 如果你创建一个没有部分然后在后续更新中添加这些部分是否有效?
  • 聪明的建议。是的,我试过了,但这也不起作用。在此测试期间,我还更新了纯文本内容以检查是否确实应用了更新:纯文本创建/更新良好;但 HTML 部分仍为空
  • 对于那些对 API V2 php wrapper 感兴趣的人,这里有一个不错的github.com/drewm/mailchimp-api

标签: php api mailchimp


【解决方案1】:

好的。知道了。我假设我使用的是 API V2 php 包装器。在深入研究 php 包装器源代码后,我发现它是 API V1.3 包装器,因此我使用了一个已弃用的 API,它不支持从模板创建活动的 HTML 部分。 ——

【讨论】:

    猜你喜欢
    • 2019-05-10
    • 2014-06-30
    • 2017-12-04
    • 2023-03-09
    • 2023-03-12
    • 2012-10-02
    • 2019-06-11
    • 2016-01-11
    • 1970-01-01
    相关资源
    最近更新 更多