Created
May 29, 2016 19:34
-
-
Save Kikimora/dd33ca9fdee08e21e600f845f78d71e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections; | |
public class CollectLead : MonoBehaviour { | |
public InputField firstName, lastName, phone; | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
public void OnSubmit() { | |
StartCoroutine(SendLead()); | |
} | |
IEnumerator SendLead() { | |
WWWForm form = new WWWForm(); | |
form.AddField("oid", "00D36000000jx5Q"); | |
form.AddField("first_name", firstName.text); | |
form.AddField("last_name", lastName.text); | |
form.AddField("phone", phone.text); | |
Debug.Log ("Sending: " + firstName.text + " " + lastName.text + " " + phone.text); | |
WWW w = new WWW("https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8", form); | |
yield return w; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment