D
D
Dmitry2016-08-27 15:02:39
PHP
Dmitry, 2016-08-27 15:02:39

How to make FormIt [MODX] and ROISTAT friends?

Hello omniscient ALL!
There is a site on MODX and a form on the site page. The form is processed using FormIt. There is a need, in addition to directly sending the form itself, to send more data from this form in an array to ROISTAT. The latter proposes to implement the integration in this way .
Tell me which way to dig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2016-08-27
@totalcount

I asked it myself, and I’ll answer it myself:
Here we put this into a snippet, for example: hook.Roistat

<?php
$roistatData = array(
    'roistat' => isset($_COOKIE['roistat_visit']) ? $_COOKIE['roistat_visit'] : null,
    'key'     => 'key',
    'title'   => $hook->getValue('name') . ' (' . $hook->getValue('ticket') . ')',
    'name'    => $hook->getValue('name'),
    'email'   => $hook->getValue('email'),
    'phone'   => $hook->getValue('telephone'),
    'is_need_callback' => '0',
);
  
file_get_contents("https://cloud.roistat.com/api/proxy/1.0/leads/add?" . http_build_query($roistatData));

return true;

When calling FormIt, we do this:
If it is not clear how to pass additional fields or filter by deals/projects, write in a personal message and I will help/tell you.

S
Sanes, 2016-08-27
@Sanes

Check out my bike . Might fit.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question