• <legend id='QWI6m'><style id='QWI6m'><dir id='QWI6m'><q id='QWI6m'></q></dir></style></legend>

    <tfoot id='QWI6m'></tfoot>

      <small id='QWI6m'></small><noframes id='QWI6m'>

        <bdo id='QWI6m'></bdo><ul id='QWI6m'></ul>

      1. <i id='QWI6m'><tr id='QWI6m'><dt id='QWI6m'><q id='QWI6m'><span id='QWI6m'><b id='QWI6m'><form id='QWI6m'><ins id='QWI6m'></ins><ul id='QWI6m'></ul><sub id='QWI6m'></sub></form><legend id='QWI6m'></legend><bdo id='QWI6m'><pre id='QWI6m'><center id='QWI6m'></center></pre></bdo></b><th id='QWI6m'></th></span></q></dt></tr></i><div id='QWI6m'><tfoot id='QWI6m'></tfoot><dl id='QWI6m'><fieldset id='QWI6m'></fieldset></dl></div>

      2. 嘿,如何从 laravel 中的 klaviyo php-sdk 在 laravel 中收集短信同意

        Hey, How to collect sms Consent in laravel from klaviyo php-sdk in laravel(嘿,如何从 laravel 中的 klaviyo php-sdk 在 laravel 中收集短信同意)
      3. <legend id='pDCuj'><style id='pDCuj'><dir id='pDCuj'><q id='pDCuj'></q></dir></style></legend>
              <bdo id='pDCuj'></bdo><ul id='pDCuj'></ul>
              <tfoot id='pDCuj'></tfoot>
                <tbody id='pDCuj'></tbody>

              <small id='pDCuj'></small><noframes id='pDCuj'>

            • <i id='pDCuj'><tr id='pDCuj'><dt id='pDCuj'><q id='pDCuj'><span id='pDCuj'><b id='pDCuj'><form id='pDCuj'><ins id='pDCuj'></ins><ul id='pDCuj'></ul><sub id='pDCuj'></sub></form><legend id='pDCuj'></legend><bdo id='pDCuj'><pre id='pDCuj'><center id='pDCuj'></center></pre></bdo></b><th id='pDCuj'></th></span></q></dt></tr></i><div id='pDCuj'><tfoot id='pDCuj'></tfoot><dl id='pDCuj'><fieldset id='pDCuj'></fieldset></dl></div>
                  本文介绍了嘿,如何从 laravel 中的 klaviyo php-sdk 在 laravel 中收集短信同意的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  大家好,有谁知道如何从 这个包在 laravel 中.

                  Hey guys does anyone knows the way around to add an SMS content in klaviyo from this package in laravel.

                  基本上我已经添加了这段代码,我可以在其中添加配置文件并看到用户电子邮件旁边的绿色复选标记,但对于 SMS,它不会出现在那里.在阅读了其他人面临的一些类似问题后,我发现我们需要一个 API 的订阅端点来添加 SMS 的同意,但我仍然找不到使用这个包的方法.任何帮助和建议将不胜感激.

                  Basically I've added this piece of code where I can add the profile and see that green check next to user's email but for SMS it don't appear there. After reading some similar issues faced by others, I found that we need a subscribe endpoint of API to add consent of SMS, But I still can't find a way to do it with this package. Any help and suggestions would be appreciated.

                  use KlaviyoKlaviyo as Klaviyo;
                  use KlaviyoModelEventModel as KlaviyoEvent;
                  use KlaviyoModelProfileModel as KlaviyoProfile;
                  
                  
                  class KlaviyoformsController extends Controller
                  {
                      public function index()
                      {
                          $client = new Klaviyo('Your_private_key', 'public key');
                          $event =
                              new KlaviyoEvent(
                                  array(
                                      'event' => 'Lead',
                                      'customer_properties' => array(
                                          '$email' => "someone@mailinator9.com",
                                          '$consent' => ['sms', 'email'],
                                          'sms_consent' => true,
                                          'email_consent' => true,
                                          '$first_name' => "Thomas9",
                                          '$last_name' => "Jefferson",
                                          '$phone_number' => "1234567890"
                                      ),
                                      'properties' => array()
                                  )
                                  );
                          
                  
                  
                  
                          $client->publicAPI->track( $event, true );
                          return view('klaviyoform::dashboard.index');
                      }
                  }
                  ```
                  

                  推荐答案

                  你必须在 Laravel 中有一个用于同意提交的捕获表单,然后它将使用适当的同意数据订阅它们.您必须明确征求电子邮件和短信同意.

                  You must have a capture form for the consent submission within Laravel that will then subscribe them with the appropriate consent data. You must explicitly ask for both email and sms consent.

                  $client = new Klaviyo('Your_private_key', 'public key');
                  
                  $customer_properties =  [
                      '$email' => "someone@mailinator9.com",
                      '$first_name' => "Thomas9",
                      '$last_name' => "Jefferson",
                      'phone_number' => "1234567890"
                  ];
                  
                  $consents = [];
                  
                  if (request()->get('sms_consent', false)) {
                    $consents['sms_consent'] = true;
                  }
                  
                  if (request()->get('email_consent', false)) {
                    $consents['email_consent'] = true;
                  }
                  
                  foreach ($consents as $type => $consented) {
                    if ($consented) {
                      $consents['$consent'] = array_merge(
                          data_get($consents, '$consent', []), 
                          [explode('_', $type)[0]] //e.g. sms, email
                      );
                    }
                  }
                  
                  $client->lists->addSubscribersToList('ListId', array_merge($customer_properties, $consents));
                  

                  这是相对的伪代码,但目标很明确:确定他们是否允许同时短信和电子邮件同意.如果是这样,我们将添加他们的同意属性.

                  This is relative psuedo code but the goal is clear: Determine if they allowed both sms and email consent. If so, we'll add their consent properties.

                  将同意数据添加到该列表后,您可以根据客户的选择安全地向他们发送短信和/或电子邮件.

                  Once the consent data has been added to that list you can safely send them sms and/or email based on the customers choice.

                  这篇关于嘿,如何从 laravel 中的 klaviyo php-sdk 在 laravel 中收集短信同意的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                        <tfoot id='katRG'></tfoot>
                          <bdo id='katRG'></bdo><ul id='katRG'></ul>

                              <tbody id='katRG'></tbody>

                          1. <small id='katRG'></small><noframes id='katRG'>

                            <i id='katRG'><tr id='katRG'><dt id='katRG'><q id='katRG'><span id='katRG'><b id='katRG'><form id='katRG'><ins id='katRG'></ins><ul id='katRG'></ul><sub id='katRG'></sub></form><legend id='katRG'></legend><bdo id='katRG'><pre id='katRG'><center id='katRG'></center></pre></bdo></b><th id='katRG'></th></span></q></dt></tr></i><div id='katRG'><tfoot id='katRG'></tfoot><dl id='katRG'><fieldset id='katRG'></fieldset></dl></div>
                            <legend id='katRG'><style id='katRG'><dir id='katRG'><q id='katRG'></q></dir></style></legend>