A
A
aleksandr-n2016-04-06 10:07:26
Drupal
aleksandr-n, 2016-04-06 10:07:26

Drupal web forms Leads?

Hello everyone!
I need Drupal experts who know web forms well.
There is a task to set up and connect 4 different sites on different CMS to the bitrix-24 portal through Leads so that all form notifications arrive in the portal 3 sites are ready CMS were Wordpress and Modx, but Drupal does not come out.
I need to find the .php file on Drupal, the form handler that sends these messages to EMAIl, it can also be the ajax.php file.
This file should contain form field names and form method="post".
Here is the lead script itself that needs to be put inside the .php file
file_get_contents(" https://test.ru/lead2bit24/lead.add.php ". "&PHONE=".urlencode($_POST['submitted[phone]']). "&COMMENTS=".
"?client_id=4c7c19329fe4a6dfb58b172c24c7433a".
"&NAME=".urlencode($_POST['
"&SOURCE_ID=3"
);
It looks something like this prntscr.com/aoqidc

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Yankovsky, 2016-10-01
@webpavilion

Hacking some file in the kernel or contribut is a bad idea. What you need in Drupal is easy to do. In your module, you need to define hook_form_FORM_ID_alter in which you specify how and where to send

$form['#action'] = 'http://text.ru/lead....';
$form['#method'] = 'GET';
$form['#pre_render'][] = 'MODULENAME_external_pre_render';

In the MODULENAME_external_pre_render function, clean up the unnecessary (and add the necessary one):
Ajax is a little more complicated, but the principle is the same, everything is done in hook_form_alter via the Form API.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question