Skip to content

Instantly share code, notes, and snippets.

@Kikimora
Created May 29, 2016 19:34
Show Gist options
  • Save Kikimora/dd33ca9fdee08e21e600f845f78d71e5 to your computer and use it in GitHub Desktop.
Save Kikimora/dd33ca9fdee08e21e600f845f78d71e5 to your computer and use it in GitHub Desktop.
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