Some contact forms need to be additionally sent to SalesForce after submission. The 5pm task should provide the necessary values to use in your script.
The info below will help you set up a curl script to use on the confirmation page of your form.
Field ID | Description | Expected Value | Example | Notes |
---|---|---|---|---|
oid |
Org ID | 15-char ID string | - | Check txt file in task. The ID is always the same. |
Campaign_ID |
Campaign ID | 15-char ID string | 7014M000001ly8F | Provided in task. Verify in campaign table below. Sometimes the ID is provided with 3 extra capital letters at the end (i.e. QAA) - do not include those. |
00N6100000BoioW |
Lead Channel | String | Web Lead - GS | Provided in task |
00N6100000BFLfu |
Division | String | GS - Gutter Shutter | Provided in task |
00N6100000H6kN9 |
Initial Campaign Source | String | 2021 GS- Web Lead | Provided in task |
00N6100000BoNDm |
Source Description | String | 2021 GS- Web Lead | Same as Initial Campaign Source |
recordType |
SF record type | 15-char ID string | 01261000000SI8a | Provided in task. Will usually be 01261000000SI8a . Can be provided with extra capital letters at the end - ignore those. |
00N4M00000IqUut |
Comments | String | $_POST[“form_logger_Message”] | – |
Field ID | Description | Expected Value | Example | Notes |
---|---|---|---|---|
first_name |
First name | Form input value | $_POST[“form_logger_First_Name”] | – |
last_name |
Last name | Form input value | Same as above | – |
company |
Company name | Form input value | Same as above | – |
email |
Email address | Form input value | Same as above | – |
phone |
Customer phone | Form input value | Same as above | – |
street |
Street address | Form input value | Same as above | – |
city |
City | Form input value | Same as above | – |
state |
Customer state | Form input value | Same as above | – |
zip |
ZIP code | Form input value | Same as above | – |
7014M000001XByp
: 2021 AS- Web Lead
7014M000001ly8m
: 2021 SOEO- Cold Call
7014M000001ly8n
: 2021 SOE- Student Referral
7014M000001ly7f
: 2021 RD- Request Sample Form
7014M000001ly7g
: 2021 SOEO- Web Lead
7014M000001ly7h
: 2021 TH-Web Lead (Concrete Repair)
7014M000001ly7i
: 2021 TH- Web Lead (Home Comfort)
7014M000001ly8D
: 2021 TH- Web Lead (Radon)
7014M000001ly8E
: 2021 TH- Web Lead (Gutters)
7014M000001ly8F
: 2021 TH- Web Lead (Junk Removal)
7014M000001ly8N
: 2021 AS- Dealer Referral
7014M000001ly8O
: 2021 TBF- Cold Call
7014M000001ly7G
: 2021 SOEO- Free Trial
7014M000001ly7H
: 2021 TH- Web Lead (Roofing)
7014M000001ly7y
: 2021 TBF- Web Lead
7014M000001ly7z
: 2021 TH- Web Lead (Basement Waterproofing)
7014M000001ly80
: 2021 TH- Web Lead (Basement Finishing)
7014M000001ly84
: 2021 TH-Web Lead (Fencing Page)
7014M000001ly83
: 2021 TH-Web Lead (Foundation Repair)
7014M000001ly8c
: 2021 AS- Prospect Referral
7014M000001ly7t
: 2021 RD- Reg. Installer Form
7014M000001ly88
: 2021 TH-Web Lead
7014M000001ly8h
: 2021 BSI- Web Lead
7014M000001ly8X
: 2021 AS- Cold Call
7014M000001lyrw
: 2021 GS- Web Lead
7014M000001ly7e
: 2021 HPM-Web Lead
7014M000001ly7j
: 2021 HPM-Home Owner
7014M000001ly7o
: 2021 KRS - Web Lead
7014M000001ly7K
: 2021 CNGO- Web Lead
7014M000001ly7P
: 2021 CN Web Lead
7014M000001ly7U
: 2021- CNM Web Lead
7014M000001ly7Z
: 2021 DES- Web lead
This example is a modified version of what’s on Gutter Shutter. See the “Become A Dealer Thank You” page in the CMS for full setup including captcha. All request data here is placed in an array to make it more legible and easier to edit.
$sfurl = "https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8";
$data = array(
'oid' => '[insert oid from txt file]',
'first_name' => $_POST["form_logger_First_Name"],
'last_name' => $_POST["form_logger_Last_Name"],
'company' => $_POST["form_logger_Company"],
'street' => $_POST["form_logger_Street"],
'city' => $_POST["form_logger_City"],
'state' => $_POST["form_logger_State"],
'zip' => $_POST["form_logger_Zip_Code"],
'phone' => $_POST["form_logger_Phone"],
'email' => $_POST["form_logger_Email_Address"],
'00N4M00000IqUut' => $_POST["form_logger_Message"], // not requried
'00N6100000BoioW' => 'Web Lead - GS', //Lead Channel
'Campaign_ID' => '7014M000001lyrw', //Campaign
'00N6100000BoNDm' => '2021 GS-Web Lead', //Source Description
'00N6100000H6kN9' => '2021 GS-Web Lead', //Initial Campaign Source
'00N6100000BFLfu' => 'GS - Gutter Shutter', //Division
'recordType' => '01261000000SI8a'
);
$sfdata = http_build_query($data);
$sf = curl_init();
curl_setopt($sf, CURLOPT_URL, $sfurl);
curl_setopt($sf, CURLOPT_POST, 1);
curl_setopt($sf, CURLOPT_POSTFIELDS, $sfdata);
curl_setopt($sf, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($sf, CURLOPT_SSL_VERIFYPEER, false);
$sfresponse = curl_exec($sf);
curl_close($sf);
Treehouse site - most forms forward data to SF. Check the confirmation pages for details.