Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter braymond64

    (@braymond64)

    Thank you!

    Thread Starter braymond64

    (@braymond64)

    Does the above information help at all?

    Thread Starter braymond64

    (@braymond64)

    It is a multiselect with nothing selected – it’s not a mandatory field. I tried a test with an option selected, but it had no effect. Maybe the code below will help? This is the salesforce integration portion of a different form on our site that does work. It was coded by somebody else before I started working on the site. I’ve swapped out identifying information.

    /* —————————————————————- */

    function add_to_salesforce($name, $email, $company, $city, $state, $zip, $country, $phone, $street, $leadsource, $jobtitle, $description, $contactType) {
    // simple way of breaking apart the name
    $names = split(” “, $name);

    //Check to see if cURL is installed …
    if (!function_exists(‘curl_init’)) {
    die(‘Sorry cURL is not installed!’);
    }

    //set POST variables
    $url = ‘https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8’;
    $fields = array(
    ‘first_name’=>urlencode($names[0]),
    ‘last_name’=>urlencode($names[1]),
    ‘company’=>urlencode($company),
    ‘street’=>urlencode($street),
    ‘city’=>urlencode($city),
    ‘state’=>urlencode($state),
    ‘zip’=>urlencode($zip),
    ‘country’ => urlencode($country),
    ’email’=>urlencode($email),
    ‘phone’=>urlencode($phone),
    ‘description’=>urlencode($description),
    ‘<digits>’ => ‘Contact form’,
    ‘<digits>’ => urlencode($leadsource),
    ‘<digits>’ => urlencode($contactType),
    ‘title’ => urlencode($jobtitle),
    ‘oid’ => ‘<digits>’, // id
    //’retURL’ => urlencode( get_site_url().’/contact-us’ ), // Don’t need a return URL
    ‘debug’ => ‘0’,
    ‘debugEmail’ => urlencode(“<email>”),
    );

    //url-ify the data for the POST
    $fields_string = ”;
    foreach($fields as $key=>$value) { $fields_string .= $key.’=’.$value.’&’; }
    rtrim($fields_string,’&’);

    //open connection
    $ch = curl_init();

    //set the url, number of POST vars, POST data
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_POST,count($fields));
    curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

    curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER, FALSE);
    curl_setopt($ch,CURLOPT_FOLLOWLOCATION, FALSE);

    //execute post
    $result = curl_exec($ch);

    //close connection
    curl_close($ch);
    }

    add_to_salesforce($contactName,$contactEmail,$contactCompany,$contactCity,$contactState,$contactZip,$contactCountry,$contactPhone,$contactAddress1,’Sonics Website’,$contactJobTitle, $contactMessage,$contactType);

    /* —————————————————————- */

    Thread Starter braymond64

    (@braymond64)

    Below is the email from Forms: 3rd Party Integration Debug [Forms3rdPartyIntegration-debug@sonicsinc.com] titled Forms: 3rd Party Integration Debug: Salesforce with information redacted:

    *** Service ***
    Array
    (
    [name] => Salesforce
    [url] => https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8
    [forms] => Array
    (
    [0] => cf7_3862
    )

    [success] => Thank you for your submission. A Sonics representative will follow up with you soon.
    [failure] => We’re sorry. There was an error with your contact request.
    [timeout] =>
    [mapping] => Array
    (
    [0] => Array
    (
    [lbl] =>
    [src] => name
    [3rd] => contactName
    )

    [1] => Array
    (
    [lbl] =>
    [src] => job-title
    [3rd] => contactJobTitle
    )

    [1418886179864] => Array
    (
    [lbl] =>
    [src] => first-name
    [3rd] => contactFirstName
    )

    [1418886195673] => Array
    (
    [lbl] =>
    [src] => last-name
    [3rd] => contactLastName
    )

    [2] => Array
    (
    [lbl] =>
    [src] => company
    [3rd] => contactCompany
    )

    [3] => Array
    (
    [lbl] =>
    [src] => email
    [3rd] => contactEmail
    )

    [4] => Array
    (
    [lbl] =>
    [src] => phone
    [3rd] => contactPhone
    )

    [5] => Array
    (
    [lbl] =>
    [src] => address
    [3rd] => contactAddress1
    )

    [6] => Array
    (
    [lbl] =>
    [src] => city
    [3rd] => contactCity
    )

    [7] => Array
    (
    [lbl] =>
    [src] => state
    [3rd] => contactState
    )

    [8] => Array
    (
    [lbl] =>
    [src] => zip
    [3rd] => contactZip
    )

    [9] => Array
    (
    [lbl] =>
    [src] => country
    [3rd] => contactCountry
    )

    [10] => Array
    (
    [lbl] =>
    [src] => topic
    [3rd] => contactType
    )

    [11] => Array
    (
    [lbl] =>
    [src] => message
    [3rd] => contactMessage
    )

    [12] => Array
    (
    [lbl] => Receive Sonics’ Monthly Newsletter
    [src] => checkbox-533
    [3rd] =>
    )

    [13] => Array
    (
    [val] => 1
    [lbl] => ID to integrate with Sonics’ Salesforce
    [src] => <our oid>
    [3rd] => oid
    )

    [1418886214085] => Array
    (
    [lbl] =>
    [src] =>
    [3rd] =>
    )

    )

    [separator] =>
    )

    *** Post (Form) ***
    http://sonicsinc.com/contact-form-salesforce/
    Array
    (
    [_wpcf7] => 3862
    [_wpcf7_version] => 4.0.2
    [_wpcf7_locale] => en_US
    [_wpcf7_unit_tag] => wpcf7-f3862-p4704-o1
    [_wpnonce] => 858cfbcda4
    [first-name] => test
    [last-name] => test
    [job-title] => test
    [company] => test
    [email] => <email address>
    [phone] => test
    [country] => test
    [message] => test
    [_wpcf7_is_ajax_call] => 1
    [topic] => Array
    (
    [0] =>
    )

    [default:1] => Array
    (
    [0] =>
    )

    )

    *** Post (to Service) ***
    Array
    (
    [timeout] => 10
    [body] => Array
    (
    [contactJobTitle] => test
    [contactFirstName] => test
    [contactLastName] => test
    [contactCompany] => test
    [contactEmail] => <email address>
    [contactPhone] => test
    [contactCountry] => test
    [contactType] =>
    [contactMessage] => test
    [oid] => <our oid>
    )

    )

    *** Response ***
    Array
    (
    [headers] => Array
    (
    [date] => Fri, 19 Dec 2014 09:52:59 GMT
    [set-cookie] => BrowserId=79qr1uT7QGC2dVX79TPR8Q;Path=/;Domain=.salesforce.com;Expires=Tue, 17-Feb-2015 09:52:59 GMT
    [expires] => Thu, 01 Jan 1970 00:00:00 GMT
    [cache-control] => private,s-maxage=0
    [content-type] => text/html;charset=UTF-8
    [connection] => close
    )

    [body] =>
    [response] => Array
    (
    [code] => 200
    [message] => OK
    )

    [cookies] => Array
    (
    [0] => WP_Http_Cookie Object
    (
    [name] => BrowserId
    [value] => 79qr1uT7QGC2dVX79TPR8Q
    [expires] => 1424166779
    [path] => /
    [domain] => .salesforce.com
    )

    )

    [filename] =>
    )

    Thread Starter braymond64

    (@braymond64)

    Below is the email from CF7-3rdparty Debug [CF7-3rdparty-debug@sonicsinc.com] titled CF7-3rdParty Integration Failure: Salesforce — with information redacted:

    There was an error when trying to integrate with the 3rd party service {Salesforce} (https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8).

    **FORM**
    Title: Sonics Contact Form English
    Intended Recipient: <email address>
    Source: http://sonicsinc.com/contact-form-salesforce/

    **SUBMISSION**
    Array
    (
    [timeout] => 10
    [body] => Array
    (
    [contactJobTitle] => test
    [contactFirstName] => test
    [contactLastName] => test
    [contactCompany] => test
    [contactEmail] => <email address>
    [contactPhone] => test
    [contactCountry] => test
    [contactType] =>
    [contactMessage] => test
    [oid] => <our oid>
    )

    )

    **RAW RESPONSE**
    Array
    (
    [reason] => Could not locate success clause within response
    [safe_message] => Success Clause not found
    [clause] => Thank you for your submission. A Sonics representative will follow up with you soon.
    [response] =>
    )

    Thread Starter braymond64

    (@braymond64)

    Anybody?

    Thread Starter braymond64

    (@braymond64)

    I hired somebody to resolve this. In case it’s helpful to others, below are the steps he took to make it work again.

    1. It came down to the get_site_by_path( $domain, $path, $segments ) function defined in wp-includes/ms-load.php

    2. By var_dump’ing the data, I found out it was running a final SQL query to look for:

    SELECT * FROM wp_blogs WHERE domain = ‘jp.sonicsinc.com’ AND path = ‘/’

    3. In the wp_blogs table, wp_blogs.path column was empty for both subdomains.

    4. I updated this via Network Admin > Sites > Edit Site (update path from blank to a forward slash).

    Thanks everybody for your replies!
    braymond

    Thread Starter braymond64

    (@braymond64)

    Yep, that’s the whole thing.

    I didn’t set up the subdomains. They were set up before I started working with the company. I’ve requested the login information, but people are out for the holidays. I should definitely get the information tomorrow, but I’m hoping for sooner.

    Thread Starter braymond64

    (@braymond64)

    This is my .htaccess file:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    I’ve requested the login for the hosting company and I’m hoping to get it soon. This is an existing multisite and it didn’t have issue before.

    Thread Starter braymond64

    (@braymond64)

    Yes, I tried that. Any other thoughts, Multisite Heroine? I need one of those right now. :-}

Viewing 10 replies - 1 through 10 (of 10 total)