【问题标题】:Creating campaign for dynamic TextMerge segment fails为动态 TextMerge 段创建活动失败
【发布时间】:2018-01-21 17:37:19
【问题描述】:

我正在尝试根据自定义数字合并字段(在本例中为GMT_OFFSET)将活动发送到动态列表段,但下面的代码会从 MailChimp API 产生以下错误:

"errors" => [
    0 => [
      "field" => "recipients.segment_opts.conditions.item:0"
      "message" => "Data did not match any of the schemas described in anyOf."
    ]
]

我的代码,使用drewm/mailchimp-api 2.4:

$campaign = $mc->post('campaigns', [
    'recipients' => [
        'list_id' => config('services.mailchimp.list_id'),
            'segment_opts' => [
                'conditions' => [
                    [
                        'condition_type' => 'TextMerge',
                        'field' => 'GMT_OFFSET',
                        'op' => 'is',
                        'value' => 2,
                    ],
                ],
                'match' => 'all',
            ],
        ],
    ],
    // Cut for brevity
];

如果我从字面上理解字段描述(见下文),TextMerge 条件类型仅适用于 merge0EMAIL 字段,考虑到分段类型标题说它是“文本或数字合并字段段”。但是,其他人报告说,当专门应用于 EMAIL 字段时,条件确实有效。 (API Reference)

从 2017 年 1 月起,我在 DrewM 的 git repo (here) 和 SO (here) 上发现了这个问题,但尚未解决。希望现在有人已经解决了这个问题,或者找到了解决方法。

【问题讨论】:

    标签: php mailchimp segment mailchimp-api-v3.0


    【解决方案1】:

    解决了!我传递了一个整数值,考虑到我的 GMT_OFFSET 合并字段是数字类型,这似乎是有意义的。 MailChimp 支持说这可能导致错误,并建议我发送一个字符串。现在就像一个魅力。

    【讨论】:

      猜你喜欢
      • 2015-03-11
      • 1970-01-01
      • 1970-01-01
      • 2015-12-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多