MailChimp Campaign内容更新

Rav*_*ous 8 rest mailchimp mailchimp-api-v3.0

MailChimp广告系列内容文档 - https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/content

我正在尝试通过API将广告系列内容中的某些占位符替换为实际值.起初,我认为可能存在一些语法错误或内部逻辑错误,例如非唯一mc:edit的错误mc:repeatable,这会使得MailChimp拒绝/拒绝HTML,因此更新没有发生,但事实并非如此.

尝试用简单的替换html,<p>test</p>它仍然无法正常工作.

这里有几个本地日志,我将使用xyz作为我的广告系列ID:

2018-02-26 16:26:13 [::1][9804][-][warning][application] calling GET /campaigns/xyz/content []

2018-02-26 16:26:13 [::1][9804][-][warning][application] got both plain_text and html versions of content

2018-02-26 16:26:13 [::1][9804][-][warning][application] calling PUT /campaigns/xyz/content {"html":"<p>test</p>"}

2018-02-26 16:26:14 [::1][9804][-][warning][application] got response [ 'plain_text' => 'test' + other MailChimp stuff such as footer, that were appended automatically by MailChimp, 'html' => '<p>test</p>' ]

// calling GET immediately after PUT in order to see if any update occurred

2018-02-26 16:26:14 [::1][9804][-][warning][application] calling GET /campaigns/xyz/content []

2018-02-26 16:26:14 [::1][9804][-][warning][application] got updated html (my "test" paragraph + auto footer from MailChimp) and proper plain_text

根据这些,一切看起来都很好,这意味着两个版本都按照预期进行了更新.但是,在下一个API/MailChimp仪表板请求中,它会显示旧的HTML内容,保留我刚刚在纯文本版本中进行的更新.

没有错误,没有什么可看的.它可能是任何内部MailChimp行为.

PS:我知道设置Mailchimp广告系列内容html不起作用MailChimp API v3广告系列内容模板部分,但没有提供给他们的答案是有帮助的.

PS2:我知道我应该联系MailChimp,但根据

我们的MailChimp支持团队未接受过深入的API故障排除培训.如果您需要开发人员帮助您使用API​​配置某些内容,请查看我们的专家目录,其中列出了可以聘请帮助的第三方MailChimp专家.

它们不支持API故障排除.

小智 6

MailChimp 不允许更新营销活动的 HTML 内容,因为营销活动类型基于模板。

为了更新 HTML 内容,必须将营销活动设置为自定义 HTML,而不是模板。您可以通过向/campaigns或发送 GET API 请求/campaigns/{campaign_id}content_type在响应中查找属性来检查类型(文档)。

或者,在仪表板中,可以通过编辑电子邮件的设计来确定类型。“自己编写代码”下的任何内容都是 HTML,模板当然是模板。

我不完全确定为什么对模板广告系列上的 PUT 请求的第一个响应显示更新的内容,但更改内容类型应该可以让您随心所欲地更新。

希望这可以帮助!