【问题标题】:Salesforce Lead Tracking integration with Contact forms on WordpressSalesforce Lead Tracking 与 Wordpress 上的联系表单集成
【发布时间】:2010-10-08 11:02:07
【问题描述】:

我也在WP Answers 上提出了这个问题。但由于这也使用了 Salesforce,我不确定我是否会在那里得到回复。

我在我的网站上使用联系表 7,并希望将 Salesforce 潜在客户跟踪与其集成。

按照on this site的建议,我可以用我的 oid 添加一个隐藏字段

但是当我在添加这个之后提交联系表单时,它只是卡住了,永远不会真正返回。一旦我删除隐藏字段,它就会开始正常工作。

是否有人能够将潜在客户跟踪系统与 Wordpress 联系表单插件集成?

我还尝试使用带有指令provided here 的cform。但这给出了 fopen 失败的警告。我认为那是因为 fopen 不允许使用 HTTP 包装器进行写操作。不知道作者是如何让它工作的!

不胜感激这方面的任何帮助!我不想使用 salesforce Web-to-lead 表单。谢谢。

【问题讨论】:

  • 您是否有不想使用网络引导表单的原因?
  • 是的。我想要发送请求的 IP 地址。加上使用其他插件,我可以发送一封包含信息的电子邮件,而使用 web-to-lead 插件,它只会在 Sforce 中更新。

标签: wordpress salesforce contact-form


【解决方案1】:

根据我对将 salesforce 与 cforms 集成的研究,基本原则是您需要 POST 信息需要与 cform POST 信息完全对应。

在撰写您喜欢的帖子时,我使用他们的示例表单(提供的嵌入式代码)研究了该过程,然后找到了一种让 cforms 提交数据的方法,按照他们指定的方式格式化为 https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8 他们拥有的 url以他们的形式。

如果遇到困难,请随时使用我...

【讨论】:

    【解决方案2】:

    您是否尝试过按照本文中的说明进行操作?它在您的 functions.php 中提供了您需要的 php 代码,以便将 Contact Form 7 与 Salesforce 集成:

    http://daddyanalytics.com/integrating-contact-form-7-and-salesforce/

    【讨论】:

      【解决方案3】:

      我花了几个小时寻找解决方案,但没有任何效果,我尝试了所有推荐的解决方案,例如http://daddyanalytics.com/integrating-contact-form-7-and-salesforce/http://www.alexhager.at/how-to-integrate-salesforce-in-contact-form-7/ 我解决了这个问题:)

      我也试过插件https://wordpress.org/plugins/forms-3rdparty-integration/

      但是没有任何效果,然后在搜索过程中有人发布了带有钩子 wpcf7_mail_components 的解决方案。当我使用代码时,代码真的很有效,这要感谢那个人。我现在不记得链接了。但是,我的目标是让 wpcf7_before_send_mail 可调用和可访问。因为上述建议从未调用过它。

      然后我介绍了最后两个参数,即

      add_action('wpcf7_before_send_mail', 'my_conversion', 10, 1); //this will call the hook

      add_action('wpcf7_before_send_mail', 'my_conversion'); //not calling the hook for me

      add_action('wpcf7_before_send_mail', 'my_conversion', 10); //also not calling the hook for me

      如果能解决你的问题,请点赞。

      所以这里是完整的解决方案:

      add_action('wpcf7_before_send_mail', 'my_conversion', 10, 1);
      
      function my_conversion($cf7) {
          $email = $cf7->posted_data["email"];
          $name = $cf7->posted_data["name"];
          $phone = $cf7->posted_data["phone"];
          $business_type = $cf7->posted_data["business-type"];
          $no_stations = $cf7->posted_data["number-of-stations"];
          $lead_source = $cf7->title;
      
          $post_items[] = 'oid=<YOUR-SALES-FORCE-ID>';
          $post_items[] = 'name=' . $name;
          $post_items[] = 'email=' . $email;
          $post_items[] = 'phone=' . $phone;
          $post_items[] = 'business_type=' . $business_type;
          $post_items[] = 'no_of_stations=' . $no_stations;
          $post_items[] = 'lead_source=' . $lead_source;
          if (!empty($name) && !empty($phone) && !empty($email)) {
              $post_string = implode('&', $post_items);
      // Create a new cURL resource
              $ch = curl_init();
      
              if (curl_error($ch) != "") {
      // error handling
              }
      
              $con_url = 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
              curl_setopt($ch, CURLOPT_URL, $con_url);
      // Set the method to POST
              curl_setopt($ch, CURLOPT_POST, 1);
      // Pass POST data
              curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
              curl_exec($ch); // Post to Salesforce
              curl_close($ch); // close cURL resource
          }
      }
      

      【讨论】:

        【解决方案4】:

        这对我有用,只需记住将“联系表格 1”更改为您要执行操作的表格名称,并输入您的 salesforce 业务 ID 而不是示例一。

        add_action( 'wpcf7_before_send_mail', 'my_conversion' );
        function my_conversion( $contact_form ) {
        $title      = $contact_form->title;
        $submission = WPCF7_Submission::get_instance();
        
        if ( $submission ) {
            $posted_data = $submission->get_posted_data();
        }
        
        if ( 'Contact form 1' == $title ) {
        
            $email = $posted_data["your-email"];
            $name  = $posted_data["first-name"];
            $last  = $posted_data["last-name"];
            $phone  = $posted_data["tel"];
            $company  = $posted_data["company-name"];
            $company_size = $posted_data["menu-870"];
        
        
            $post_items[] = 'oid=00vF80000003zx6';
            $post_items[] = 'first_name=' . $name;
            $post_items[] = 'last_name=' . $last;
            $post_items[] = 'email=' . $email;
            $post_items[] = 'phone=' . $phone;
            $post_items[] = 'company=' . $company;
            $post_items[] = '00df800000BypGb=' . $company_size;
        
            $post_string = implode( '&', $post_items );
        
            $ch = curl_init( 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8' );
            curl_setopt( $ch, CURLOPT_POSTFIELDS, $post_string );
            curl_setopt( $ch, CURLOPT_POST, 1 );
            curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
            curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
            curl_exec( $ch ); // Post to Salesforce
            curl_close( $ch ); // close cURL resource
        }
        }
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2022-06-10
          • 2013-06-19
          • 1970-01-01
          • 2017-04-29
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-10-05
          相关资源
          最近更新 更多