【发布时间】: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