If your site is built on WordPress then it is very simple to integrate Enjay Click2Call service.


1) Install contact form 7

     Please find the below link :

     https://wordpress.org/plugins/contact-form-7/

     Get Help on Contact Form 7 : https://wordpress.org/support/plugin/contact-form-7

     Create a contact form and use it on any page.


2) Go to below path to add customized code in contact form 7 plugin.

 

     yoursite​/wp-content/plugins/contact-form-7/includes/

 

     find file : submission.php


     Note: Remember that do not update plugin after making these changes.


3) In file find function (private function setup_posted_data()) and

     before below line paste given code.

     return $this->posted_data; // find this line in function

 

     Note : remember to replace the variable names

     //copy below code before this line return $this->posted_data;


     ============= Code to Copy =======================


     //Note : Here 3960 id will be replaced with id of your contact form

     // Example : [contact-form-7 id="3960" title="Enjay click to call"]

 

if($this->contact_form->id()==3960){


               
//contact details going into enjay click2call service

                $website_visitor_email = $this->posted_data['website-visitor-email'];

                //Note : here website-visitor-email is field name provided in contact form 7 from admin panel of wordpress


                $website_visitor_name = $this->posted_data['website-visitor-name'];

                //Note : here website-visitor-name is field name provided in contact form 7


                $website_visitor_mobile = $this->posted_data['website-visitor-mobile'];

                //Note : here website-visitor-mobile is field name provided in contact form 7


                $apikey = 'provide_your_apikey_here';

                $departmentid = 'provide_your_department_id';


                //Note : find apikey and department id from sample code provided to you.

                $calldetails = '{"apikey":"' . $apikey . '","departmentid":"' . $departmentid . '","email":"' . $website_visitor_email . '","name":"' . $website_visitor_name . '","number":"' . $website_visitor_mobile . '"}';

                $calldetails = urlencode($calldetails);

                $synapseactionurl = 'http://app.enjayclick2call.com/ec2c.php?calldetails=' . $calldetails;


                $callurl = "http://app.enjayclick2call.com/ec2c.php";

                $curlobj = curl_init();

                $curlurl = $callurl."?calldetails=$calldetails";

                curl_setopt($curlobj, CURLOPT_URL, $curlurl);

                curl_setopt($curlobj, CURLOPT_HEADER, false);

                curl_setopt($curlobj, CURLOPT_RETURNTRANSFER, 1);

                $response = curl_exec($curlobj);

    curl_close($curlobj);

           }



Screenshots from WordPress admin panel :


Create a contact form from admin panel of wordpress using contact form 7 plugin, below is the shortcode of the form.




Above created form in Edit Mode




We have given a link on our website which redirects you to contact form.



Form visible on our website, our website is developed on WordPress framework.




Screenshot of code need to be added to file found at below path.


Path : your_website/wp-content/plugins/contact-form-7/includes/submission.php