WordPress.org

Ready to get started?Download WordPress

Forums

WordPress-to-lead for Salesforce CRM
Fails to connect with salesforce (22 posts)

  1. Donald White
    Member
    Posted 2 years ago #

    Setup the plugin as directed in the install instructions. Activated the plugin. Copied my Co. ID into the plugin settings but when I run a test and click submit I get a notice saying that it failed to connect with salesforce.

    Any help would be appreciated.

    http://wordpress.org/extend/plugins/salesforce-wordpress-to-lead/

  2. evanmcd
    Member
    Posted 2 years ago #

    I have the same issue, though mine was working fine recently. It just stopped working at some point.

  3. Nick Ker
    Member
    Posted 2 years ago #

    Can't be of much help, just a "me too" here.
    It worked OK before, but now throws up the Failed to Connect message. The contact is added, notifications sent and everything seems to work on the Salesforce end but the Plugin seems to think it is getting an error response from salesforce.
    I am going to look at the plugin and see if I can change the code in it until there is an official fix.

  4. kevinteo
    Member
    Posted 2 years ago #

    I'm experiencing the same problem as well. Any ideas on how to contact the author of this plugin?

  5. GusSalvador
    Member
    Posted 2 years ago #

    Does anybody support this plugin anymore? Where are you Joost? I too am experiencing this problem. I also desperately need to add hidden fields that will be submitted to SalesForce. This plain vanilla form is hardly useful for our company.

  6. GusSalvador
    Member
    Posted 2 years ago #

    I'd be willing to bet it's an issue with WP 3.2

    A quick and stupid fix, if your data is still submitting to salesforce, is to put the success message in the fail box.

  7. andreascreten
    Member
    Posted 2 years ago #

    It seems to be an issue with the headers coming back from Salesforce. The is-processed header is not in the response when the lead was processed correctly. It only is available when there was an error (for example when leaving out the organisation id).

    So a quick fix might be (on line 414), to change:
    if ($result['headers']['is-processed'] == "true")
    Into
    if (!isset($result['headers']['is-processed']) && $result['response']['code'] == 200)

  8. iPerceptions
    Member
    Posted 2 years ago #

    Hi all,

    I implemented the fix suggested by "andreascreten" (comment above mine in this thread) and it seems to work: the contact is created properly in SalesForce, and I don't get the rejection notice when I press submit.

    Will update this thread if I experience any problems.

    Cheers,
    Chris

  9. westonrc
    Member
    Posted 2 years ago #

    andreascreten got at the heart of the matter (it appears the WebToLead servlet used to send an "is-processed" header as part of the HTTP response headers, and now does not), but I'd suggest a slightly different test.

    The !isset($result['headers']['is-processed']) is always going to be true (unless Salesforce changes their servers back) , so it's probably not useful. Instead, it might be better to switch on debug mode in the post and test the HTTP Response body for the string it puts out ('Your request has been queued'). So change line 397 to $post['debug'] = 1;, and then try:

    if( $result['response']['code'] == 200
    	 && strpos($result['body'],'Your request has been queued') !== false )
    		return true'

    as a test.

  10. westonrc
    Member
    Posted 2 years ago #

    Should've tested a little more thoroughly before I posted... if for some reason there's a network connection error inside the wp_remote_post call, $result might not be an array. So perhaps:

    if( is_array($result)
    	 && isset($result['response']['code'])
    	 && $result['response']['code'] == 200
    	 && strpos($result['body'],'Your request has been queued') !== false )
    		return true;

    It also occurs to me that if submit_salesforce_form returns false, it might not be a bad idea to send a notification to the site admin using wp_admin.

  11. whimsy
    Member
    Posted 2 years ago #

    Thank you to westonrc and andreascreten for your help!

    I had the exact same problem, and was able to solve it once I found both parts of westonrc's solution.

  12. Nick Ciske
    Member
    Plugin Author

    Posted 2 years ago #

    This has been fixed in v2.0 which was just released!

  13. davidinottawa
    Member
    Posted 2 years ago #

    Hi All - what file are you editting the response code in ?

  14. Nick Ciske
    Member
    Plugin Author

    Posted 2 years ago #

    David,

    Version 2.0 does not require any editing. Upgrade and you'll be set.

  15. davidinottawa
    Member
    Posted 2 years ago #

    Tx Nick - but I am running 2.0 :
    Plugin Name: WordPress-to-Lead for Salesforce CRM
    Author: Joost de Valk, Nick Ciske, Modern Tribe Inc.
    Version: 2.0
    Author URI: http://tri.be/

    :-(

    I completely deactivated, uninstalled, removed all references to it in the wp_options table, verfiied the SF ID number, etc.

  16. davidinottawa
    Member
    Posted 2 years ago #

    The result loop looks like this - and when I upload it, it actually takes the entire site down!
    :-)


    if ($result['response']['code'] == 200){

    if( $_POST['w2lcc'] == 1 )
    salesforce_cc_user($post, $options);

    if( $options['ccadmin'] )
    salesforce_cc_admin($post, $options);

    return true;
    }else{

    return false;
    }

  17. Nick Ciske
    Member
    Plugin Author

    Posted 2 years ago #

    And when I upload it, it actually takes the entire site down!

    Then you have a different problem. Something in the plugin is causing a PHP error.

    Are you getting any error messages?

    Can you define what "down" looks like? (e.g. white screen, site doesn't show, admin inaccessible, etc).

  18. davidinottawa
    Member
    Posted 2 years ago #

    Ok - you're right Nick.

    I've fixed the 500 issue.
    But - it still says :
    Failed to connect to Salesforce.com.

    Is there a way I can for a GET, or print out to screen what is being sent ?


    if( is_wp_error($result) )
    return false;

    if (($result['response']['code'] == 200) && (strpos($result['body'],'Your request has been queued') !== false)) {

    if( $_POST['w2lcc'] == 1 )
    salesforce_cc_user($post, $options);

    if( $options['ccadmin'] )
    salesforce_cc_admin($post, $options);

    return true;
    }else{

    return false;
    }

  19. Nick Ciske
    Member
    Plugin Author

    Posted 2 years ago #

    You can print_r($result); to see what's coming back from SalesForce. That would help determine what the error might be (please post the output here and I'll take a look).

    That should go before the is_wp_error line.

  20. davidinottawa
    Member
    Posted 2 years ago #

    Nick - your help is greatly appreciated.

    Apparently there is no result found.

    Line 841 in salesforce.php :

    if (!$error) {
    $result = submit_salesforce_form($post, $options);

    echo 'RESULT='.$result;
    if($result) echo 'true';
    if(!$result) echo 'false';

    if (!$result){
    $content = ''.esc_html(stripslashes($options['sferrormsg'])).'';
    }else{

    Prints this to screen :
    RESULT=false

  21. Nick Ciske
    Member
    Plugin Author

    Posted 2 years ago #

    Unfortunately, that doesn't help as I already knew submit_salesforce_form was returning false (as the error is being output). What we need to see is the HTTP response from SF.

    So, you'll want to find this line (731):

    $result = wp_remote_post('https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8', $args);

    And add print_r($result); beneath it.

    That will output the actual response from SalesForce's API, which should give us a clue why it's not successfully submitting the lead.

  22. Arsham Mirshah
    Member
    Posted 2 years ago #

    Hey everyone, I know how much of a pain it can be when the connection to SalesForce doesn't work.. really hate it when the sales people are yelling at me!

    Here is a tutorial for how to connect salesforce web-to-lead with php in your wordpress website.

    It has a php form processor script that you can copy and paste with little modification and get to work.

    Let me know if it helps and if you need any help with it!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic