WordPress.org

Ready to get started?Download WordPress

Forums

Gravity Forms Salesforce Add-on
[resolved] Custome Lead Source (6 posts)

  1. GusSalvador
    Member
    Posted 2 years ago #

    Is it possible to set the Lead Source....rather than having it default to the name of the form?

    http://wordpress.org/extend/plugins/gravity-forms-salesforce/

  2. Zack Katz
    Member
    Plugin Author

    Posted 2 years ago #

    This feature support was added in version 1.1.1. gf_salesforce_lead_source is the filter.

    Here's a code sample:

    add_filter('gf_salesforce_lead_source', 'make_my_own_lead_source', 1, 3); 
    
    function make_my_own_lead_source($lead_source, $form_meta, $data) {
    	// $lead_source - What was about to be used (normally Gravity Forms Form Title)
    	// $form_meta - Gravity Forms form details
    	// $data - The data passed to Salesforce
    
    	return $lead_source; // Return something else if you want to.
    }
  3. bmartinstudio
    Member
    Posted 2 years ago #

    Can you explain a little more how to use this code?

    I put it in the functions file and set the lead source as "Website" and when my site loaded it was a blank screen.

    The code I included:

    add_filter('gf_salesforce_lead_source', 'make_my_own_lead_source', 1, 3); 
    
    function make_my_own_lead_source($lead_source, $form_meta, $data) {
    	// $lead_source - What was about to be used (normally Gravity Forms Form Title)
    	// $form_meta - Gravity Forms form details
    	// $data - The data passed to Salesforce
    
    	$lead_source = 'Website'
    
    	return $lead_source;
    }

    Thanks for your help.

  4. baraklevy
    Member
    Posted 2 years ago #

    Hi Zack

    what do i need to change in your code here?

    I created a hidden field name "lead_source" and i gave it a value, but it still use the form name

    i put your code as is in the function.php file of my theme - do i need to change something in it?

  5. nkeebaugh
    Member
    Posted 2 years ago #

    Has anyone found a solution of this?

  6. mwanthony
    Member
    Posted 2 years ago #

    bmartinstudio,

    I think you need a semicolon like so:

    $lead_source = 'Website';

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic