【问题标题】:How to output the a Shopify customer's full name on a Mailchimp list如何在 Mailchimp 列表中输出 Shopify 客户的全名
【发布时间】:2018-07-31 23:11:49
【问题描述】:

我有 Mailchimp 应用程序并设置了集成,一切似乎都正常,除了它不输出客户的全名。我可以输出名字和姓氏,但是串联输出的是0。

if($verified) {

  $customer_data = json_decode($data);
  $customer_email = $customer_data->email;
  $customer_fname = $customer_data->first_name;
  $customer_lname = $customer_data->last_name;
  $customer_name = $customer_fname + " " + $customer_lname;

  mc_subscribe($customer_email, $customer_name, $m_apikey, '$listid', 'us7');

}

function mc_subscribe($email, $name, $apikey, $listid, $server) {
  $auth = base64_encode( 'user:'.$apikey );
  $data = array(
    'apikey'        => $apikey,
    'email_address' => $email,
    'status'        => 'subscribed',
    'merge_fields'  => array(
      'MMERGE5' => $name
    )
  );

【问题讨论】:

    标签: jquery shopify mailchimp


    【解决方案1】:

    PHP 连接运算符是 (.) 而不是 (+) 所以试试这个:

    $customer_name = $customer_fname。 " ".$customer_lname;

    【讨论】:

      猜你喜欢
      • 2015-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-24
      • 2015-10-11
      • 2013-04-27
      • 2019-11-28
      • 1970-01-01
      相关资源
      最近更新 更多