cloudassessments/salesforce-web-to-lead 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cloudassessments/salesforce-web-to-lead

Composer 安装命令:

composer require cloudassessments/salesforce-web-to-lead

包简介

A PHP package for submitting data to Salesforce from the backend using their frontend Web-to-Lead method.

README 文档

README

Generally when using Salesforce's Web-to-Lead feature to send form submissions to your Salesforce instance you have to send them from the frontend by setting the HTML form target attribute to a salesforce.com URL, by-passing your own controllers and not storing submission info in your own database.

Using this package, you can send your leads to Salesforce from the backend of your application when and where you want to, ideally from the controller that already handles storing your form sumbissions.

Features

  • Send leads using the Salesforce Web-to-Lead feature from the backend of your application using PHP instead of the frontend using HTML
  • A debug option that when enabled will send you an email from Salesforce on each submission informing you whether the lead was successfully sent; and if it was not, details on what went wrong.
  • Method-chaining

Installation

Install the latest version with

$ composer require cloudassessments/salesforce-web-to-lead

Basic Usage

<?php

use CloudAssessments\Salesforce\WebToLead;

$form = new WebToLead();
$form
    ->setSalesforceAccountIdentifier('YourAccountID')  
    ->submit(                                          
        [                                              
            'first_name'      => 'John',               
            'last_name'       => 'Doe',                
            'email'           => 'johndoe@example.com',
            'phone'           => '555-123-4567',       
            'company'         => 'Acme Inc.',          
            'lead_source'     => 'Web-to-Lead',        
        ]                                              
    );

Custom Fields

The fields provided in the example above are simply the default Salesforce fields that everyone has.

However, you can create custom fields in Salesforce and use this library to submit those as well. Unfortunately, when you create a custom field in Salesforce (let's say you create a text box called Referral Source), the name attribute of that input element is a randomly generated string, e.g. 00N46000009SDY5.

The only way to find out the name of that field is to inspect your form in Salesforce from your browser and find the name attribute on the <input> element for that field.

Once you have that randomly generated string, you can use that as a key in the array when submitting to Salesforce.

For example:

use CloudAssessments\Salesforce\WebToLead;

$form = new WebToLead();
$form
    ->setSalesforceAccountIdentifier('YourAccountID')  
    ->submit(                                          
        [                                              
            'first_name'      => 'John',
            'last_name'       => 'Doe',
            'email'           => 'johndoe@example.com',
            'lead_source'     => 'Web-to-Lead',
             // Your new Referral Source field below
            '00N46000009SDY5 => 'https://example.com/referral-page',
        ]                                              
    );

统计信息

  • 总下载量: 984
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固