How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask ATLPROG Your Own Question

ATLPROG
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7677
Experience:  MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
44910485
Type Your Programming Question Here...
ATLPROG is online now
A new question is answered every 9 seconds

I'm struggling to get Contact Form 7 to integrate with Sales

Customer Question

I'm struggling to get Contact Form 7 to integrate with Sales Force on a Wordpress install. I've been using the guide located at the link below, but don't really understand PHP so proving difficult. Do you think you can help?
http://www.alexhager.at/how-to-integrate-salesforce-in-contact-form-7/
Submitted: 1 year ago.
Category: Programming
Expert:  Jinsmn replied 1 year ago.

Hello Sir/Madam. Thank you very much for giving us an opportunity to help you. I am Jins here to assist you. Please remember these things when we deal with your issue. It may take more than one step/answer to solve a problem. So If my answers don’t work or if you are not satisfied, please don’t Rate my answer as Bad or Poor Service, but please Reply back to me by clicking the “Continue Conversation” or “Reply” button and I will gladly continue to help. Remember, only Rate answer after you are 100% Satisfied. Please do not rate an answer, if you are not satisfied.

Please let me know the URL of your website. I need to check it before proceed.

Regards
Jins

Customer: replied 1 year ago.
Hi thanks for your response, site is http://www.integratedpools.canny.com.auI've followed the details as best I can, but I believe that some customisation was required and I think that's where things unravelled. I will post the actual code which I placed in the themes functions.php file shortly as well as a screen grab of the contactForm7 settings page which I'm sure you will need.
Customer: replied 1 year ago.
Salesforce integration code sourced from http://www.alexhager.at/how-to-integrate-salesforce-in-contact-form-7/
*
*/
add_action( 'wpcf7_before_send_mail', 'my_conversion' );
function my_conversion( $cf7 )
{
$email = $cf7->posted_data["your-email"];
$first_name = $cf7->posted_data["your-name"];
$phone = $cf7->posted_data["your-phone"];
$message = $cf7->posted_data["your-comments"];
$lead_source = $cf7->title;
xxxxxxxxxxxxxxxxxxxxxxxxxxx
$post_items[] = 'first_name=' . $first_name;
$post_items[] = 'email=' . $email;
$post_items[] = 'phone=' . $phone;
$post_items[] = 'description=' . $message;
$post_items[] = 'lead_source=paid_search';
if(!empty($first_name) && !empty($email) )
{
$post_string = implode ('&', $post_items);
// Create a new cURL resource
$ch = curl_init();
if (curl_error($ch) != "")
{
// error handling
}
$con_url = 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
curl_setopt($ch, CURLOPT_URL, $con_url);
// Set the method to POST
curl_setopt($ch, CURLOPT_POST, 1);
// Pass POST data
curl_setopt( $ch, CURLOPT_POSTFIELDS, $post_string);
curl_exec($ch); // Post to Salesforce
curl_close($ch); // close cURL resource
}
}
Customer: replied 1 year ago.
Here's the Contact Form 7 Form info (pasted instead of screen grabbing)[text* your-name class:form-control placeholder "Name"][text your-phone class:form-control placeholder "Phone"][email* your-email class:form-control placeholder "Email"][textarea your-comments class:form-control placeholder "Comments"][submit class:btn class:btn-blue "ENQUIRE NOW"]
Customer: replied 1 year ago.
Just following up on this. I need an answer quickly as the client is expecting this to be live today.
Customer: replied 1 year ago.
Hi I'm sorry to keep bothering you, but I really need a response tonight so that I can gain some confidence that this avenue can resolve the issue otherwise I will need to find a developer somewhere. Can I please have a response?
Expert:  Jinsmn replied 1 year ago.

Please accept my additional services offer.

Regards

Jins

Related Programming Questions