Skip to content

Instantly share code, notes, and snippets.

@eggsurplus
Created July 14, 2014 17:44

Revisions

  1. eggsurplus created this gist Jul 14, 2014.
    11 changes: 11 additions & 0 deletions WebToLeadCapture.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    if(empty($lead->id)) {
    $lead->id = create_guid();
    $lead->new_with_id = true;
    }
    //BEGIN - eggsurplus - update existing leads
    if(!empty($_POST['record'])) {
    //get the existing bean (returns null if a bad ID is passed so a new Lead will be created still)
    $lead = BeanFactory::getBean('Leads',$_POST['record']);
    $lead->new_with_id = false;
    }
    //END - eggsurplus