Customer Service

Resources that you can use.....

Knowledgebase

KnowledgeBase Articles

Articles Categories Screencasts

How can I get Leads into OpenCRM from a contact form on my website? How do the OpenCRM contact forms work and how do I customise them? Applies to Version 3.02+

Rated 5.00 starRated 5.00 starRated 5.00 starRated 5.00 starRated 5.00 star Updated: 31 October 2011 11:20:13 OpenCRM::Leads OpenCRM::Data Import-Export

Importing Leads into OpenCRM from a web form on your website

It is possible to post information gathered on a contact form on your website directly into your OpenCRM system. First of all you will need the web form package which can be obtained by contacting us at support@opencrm.co.uk.

Next you will need a friendly web developer, a bit of web development knowledge yourself, or, some professional service time from us to help you get this set up (and this guide of course...)

From this point on, we will assume that you have all of the above and are ready to go...

Note : The web to lead form that we provide interacts directly with your Leads module in OpenCRM, It is therefore very important that you protect the form from SPAM attacks, including SPAM robots. If you have any doubt about what this means or the implications to your system, please speak to your Software Add-ons Project Manager.

 

Standard Installation

The standard installation procedure assumes that you run  PHP5 with its built in SOAP functions active on your webserver. . If you do not and can not run PHP on your webserver  please proceed to instructions for Alternate Installation.

1. Extract the contents of the web form package to a folder on your website. Make sure that it is possible to run PHP scripts from this folder. If in doubt, ask your web developer or hosting company. Keep all of the files together. Do not move individual files into different locations.

2. The form is pre-configured to work "out of the box" but you will need to tell it the URL of your OpenCRM system so it knows where to post the data. in form_config.php change the following variable to be your OpenCRM login URL, e.g. https://mysite.opencrm.co.uk .

$Server_Path = 'https://mysite.opencrm.co.uk';

You may also wish to change the "PATH_TO_PRIVACY_PAGE"  variable to point to your own privacy page URL.

3. In order for OpenCRM to accept your forms submission, the form needs to be authorised to access the API, we will provide 2 API keys to be used. Enter these into the form_config.php

$key = '';
$key2 = '';

Customisation

Customising the lead form

Although the form comes with some basic formatting, you may wish to modify this and remove any fields that are not relevant. You may also wish to add additional form verification and "pre-processing" - spam checks etc. You can do this by editing leadform.php

The form by default contains a selection of fields that it is possible to post to in OpenCRM. You can remove as many as are not relevant, but you must not change the field names of the ones that you do wish to use - or they will not then post through to OpenCRM. If you wish to post to any additional fields, these can be added by someone that understands PHP and is comfortable editing the scripts see Further / advanced customisation?.

Customising the thank you message

You can customise the thank you message by editing thankyou.php. You can customise this to your hearts content. So long as the end result is valid PHP this will work.

Alternatively, you may wish to make a small modification to form_config.php and change the following line to instead do a redirect to another page on your website, but, you're on your own on that one!

$PATH_TO_THANK_YOU_PAGE = 'thankyou.php';

Further / advanced customisation?

If you know your way around a PHP script, you will soon be familiar with what the lead forms do and how they work - there is nothing too complicated about them. As such you can customise and change them as much as you like. You may wish to introduce an intermediary processing script in between the leadform submit and the send_data.php processing. Feel free!

There is a function shell already created for PHP based form validation, maybe you want to use a CAPTCHA, this is where we suggest you put any checks in.

You may wish to make modifications to send_data.php to add in some extra processing (e.g. to also send an email to someone to notify them of the form submission).

If you wish to add fields to the form, or maybe set some default values, you can edit the send_data.php to include these, all it takes is adding a few lines of code for each field

        $field_value = Array(); // the next field to be updated
        $field_value["name"]="lastname"; // the name of the field
        $field_value["value"]=$lastname; // the value to be saved from your form
        $field_values[]=$field_value; // add the value to the list

The example above is for the lastname field, and is already included by default. You can find the name for the fields in OpenCRM. If you're wanting to write to a custom field this will be for example 'cf_123'.

Another change you can make is to submit the form data into the Contacts or Company modules instead of Leads, the changes needed for this are commented out in the send_data.php code. If you change the module you are saving to, the field names will also need changing to match those used in the new module.

Alternatively, we can add extra processing on our side too, so please contact us with your requirements and we will see how we can help. This may require some professional service time dependent on your requirements.

 

Alternative Installation (What to do if you don't have PHP, or can't use PHP's SOAP functions)

If you can't use PHP's soap functions we have an alternative webform package with its own built in SOAP client, please contact us to request this version.

If you do not have PHP available to you on your webserver, or there is some other reason why the above is just not working for you - don't worry, an alternative method is available.

It is possible for us to host the form processing code for you as part of your OpenCRM installation. All you need to handle is the building of your own contact form.

You can design and build your web form in whatever language you feel comfortable in, and then just make sure that your form method is "post" and the form action points to the URL of the form processing code in your OpenCRM system. This will be e.g:

https://mysite.opencrm.co.uk/webforms/send_data.php

So, for example,  your .asp form might look something like this:


As the form processing is handled by us, any changes required to the thank you page/message or the redirect on success process, or any additional process would need to be done by us too. We may be able to do this for you as part of your support contract, but any significant or complicated changes may require professional services time to implement.

It's always best to run your requirements by us first so we can let you know in advance if you are going to need any professional service time.

 

  • Rate This Article

  • Feedback and Comments
    captcha code  


You may also be interested in:


More..

COOKIE POLICY - We use cookies to improve your experience whilst looking through our website, some of these cookies are really important, honest. We don’t sell or trade your information. You can learn more by reading our privacy policy. OpenCRM privacy policy.

continue