Mautic Community Forums

Post results to another form

Hi,



Is there anybody who can tell me how the functionality of ‘post results to another form’ works?

I’ve created a form in Mautic with five text fields. Under ‘actions’ => ‘Add a submit action’ i selected ‘post results to another form’.



As the ‘post URL’ i set https://www.domain.com/external.php



The contents of external.php is at the moment just as plain as


<?php
var_dump($_REQUEST);
?>

But still i'm not able to read the values of the form submission.

Any help i appreciated.

~ Chris

Hi,

Is there anybody who can tell me how the functionality of ‘post results to another form’ works?
I’ve created a form in Mautic with five text fields. Under ‘actions’ => ‘Add a submit action’ i selected ‘post results to another form’.

As the ‘post URL’ i set https://www.domain.com/external.php

The contents of external.php is at the moment just as plain as

<?php var_dump($_REQUEST); ?>

But still i’m not able to read the values of the form submission.

Any help i appreciated.

~ Chris

Not used this function myself so not sure how Mautic sends the data but I use this to grab post data from Stripe webhooks…

$input = @file_get_contents(“php://input”);
$post_json = json_decode($input);

Not sure if it helps…

Nope, that doesn’t work for me. Is there anybody who has a working ‘post to other form’ implementation?

~Chris

I’m looking into this now.
I was thinking it’d be useful to combine with Dynamic Content to create an instant, custom Microsite the user is redirected to.
Specifically, the redirect landing page would receive form results via the “Post to Other Form” method (hidden values that are accessible). Based on answers to questions X/Y/Z, the appropriate dynamic content could be pulled and assemble a customized microsite right away to the user.
I’m thinking this is going to be alot of work, so any community input would be greatly appreciated.
I’ll keep you posted if I figure out the answer to “Post to Other Form” that we’re actually discussing here in this thread.
Cheers!

Hi Chris,

Tested with https://requestb.in and it seems to work:

  1. create a requestbin by going to https://requestb.in, then you get a URL in the form ‘https://requestb.in/XYZ
  2. create a form in Mautic
  3. add a ‘submit action’ of type ‘Post results to another form’ and enter ‘https://requestb.in/XYZ’ in the ‘Post URL’
  4. create a landingpage in Mautic using that form
  5. submit the form
  6. refresh the ‘https://requestb.in/XYZ

You will see the entered information plus the information Mautic has collected of the user:

mautic_contact[country]: Netherlands
mautic_form[id]: 17
mautic_contact[state]: North Brabant
mautic_contact[email]: [REMOVED]
mautic_form[name]: lextest2users
mautic_contact[lastname]: [REMOVED]
mautic_contact[city]: 's-Hertogenbosch
mautic_contact[nickname]: lex test
mautic_contact[firstname]: Lex Test
mautic_contact[id]: 3441
mautic_form[url]: [REMOVED]
f_name: lex test
mautic_contact[company]: [REMOVED]
mautic_contact[timezone]: 31
email: [REMOVED]
HEADERS

Host: requestb.in
Connection: close
Connect-Time: 0
Cf-Visitor: {“scheme”:“https”}
Accept-Encoding: gzip
Content-Length: 581
Via: 1.1 vegur
Total-Route-Time: 0
Cf-Connecting-Ip: 198.20.97.202
X-Request-Id: a78b45e7-f05d-4c0b-8096-26859851eb7b
Cf-Ray: 38719790fc7e2c5a-AMS
Cf-Ipcountry: NL
User-Agent: GuzzleHttp/6.2.1 curl/7.54.0 PHP/5.6.31
Content-Type: application/x-www-form-urlencoded
RAW BODY

mautic_contact%5Bid%5D=3441&mautic_contact%5Bfirstname%5D=Lex+Test&mautic_contact%5Blastname%5D=[REMOVED]&mautic_contact%5Bcompany%5D=[REMOVED]&mautic_contact%5Bemail%5D=[REMOVED]&mautic_contact%5Bcity%5D=%27s-Hertogenbosch&mautic_contact%5Bstate%5D=North+Brabant&mautic_contact%5Bcountry%5D=Netherlands&mautic_contact%5Bnickname%5D=lex+test&mautic_contact%5Btimezone%5D=31&mautic_form%5Bid%5D=17&mautic_form%5Bname%5D=lextest2users&mautic_form%5Burl%5D=[REMOVED]&f_name=lex+test&email=[REMOVED]