Gravity Forms Integration

Has anyone developed a plugin to integrate Gravity Forms into Mautic? I use Gravity Forms on all my sites and have a lot of custom code built on top of them. I’d rather not lose all of that. Are there any hooks in Mautic I could use to integrate the two together?

Has anyone developed a plugin to integrate Gravity Forms into Mautic? I use Gravity Forms on all my sites and have a lot of custom code built on top of them. I’d rather not lose all of that. Are there any hooks in Mautic I could use to integrate the two together?

Hello, I’m not aware of a Mautic-Gravity plugin, but Mautic has API to deal with this kind of integration. Other option which will work without oAuth integration needed for API to work, you can simply create forms with the same fields in Mautic and add a CURL call to send the Gravity form data to Mautic form as well. I tried it and it works. Here is my code as an example:

    /**
     * Push data to a Mautic form
     *
     * @param array $data
     * @param integer $formId
     */
    function pushMauticForm($data, $formId)
    {
        $data['formId'] = $formId;
        $data['return'] = 'http://mautic.com';
        $data = array('mauticform' => $data);
        $formUrl = $this->getMauticBaseUrl() . '/form/submit?formId=' . $formId;

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $formUrl);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

        // receive server response ...
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $response = curl_exec($ch);
        curl_close($ch);
    }
1 Like

Thanks for your reply escopecz. Does this require that we hard code a form ID or does it read it when the post goes thru? Also, I take that http://mautic.com should be whatever my Mautic instance is yes? Pardon the newbie questions. When I place the code I get an error at “public function pushMauticForm($data, $formId)” hence my suspicions.

Best,

I copied that method from a class, so it contains the public keyword. That keyword has to be removed if the method is not in a class. Sorry, should have mention that. Use this instead:

https://medium.com/@jan_linhart/the-simplest-way-how-to-submit-a-form-data-to-mautic-1454d3afd005

The return is the URL where the form should be redirected after submit. In our case we don’t want/need any redirection, but Mautic forms require it.

You don’t have to hard code the form ID. That’s why it is a part of the method attributes.

1 Like

any update @MysticalMatt517

I need help to know where exactly should I put this code . Can someone help me? I need a step by step becouse I’m not a programmer. Thank you

@regis check this https://medium.com/@NinJoan/lifesaver-how-to-feed-mautic-with-contact-form-7-ae1245152218

Thanks @ninjoan .
It seems to be a very practical way.
I tried to use this method but I found a difficulty … maybe some error related to url. Can you tell me what am I doing wrong?
I configured like this:

And I received an email with the following content:

[code]There was an error when trying to integrate with the 3rd party service {Teste Petar} (http://ecotur.estacaofloresta.com.br/form/submit?formid=6).

FORM
Title: Petar - TESTE
Intended Recipient: --na–
Source: http://estacaofloresta.com.br/formularios/formulario-petar-teste/

SUBMISSION
Array
(
[timeout] => 10
[body] => Array
(
[Nome] => regis3
[E-mail] => regis@vidapora.com.br
)

)

RAW RESPONSE
Array
(
[reason] => Could not locate success clause within response
[safe_message] => Success Clause not found
[clause] => Sucesso integracao
[response] =>

Mautic

Este formulário não está mais disponível.

)
[/code]

Hi @regis so far I see you have the full URL with the form ID
Check this image
https://cdn-images-1.medium.com/max/800/1*Qx62Dda5jimvRnXIOLw6Tw.png

You have to create the Form ID in the mapping area

someone could tell me how do I customize the form to leave with a more friendly ency
type color- blac graud difente edge source etc , for Mauti in provides a simple very dry form
nothing only with the fields we choose.

Can you make this connection handle someone like WordPress plugin? It would help me a lot.

Christopher Penn just migrated to Mautic and recorded the process here:

http://www.christopherspenn.com/2016/04/marketing-automation-migration-part-1/

He reviews the Gravity Forms -> Mautic integration in episode 7, I believe.

I’m hoping he’ll post his code.

Thank you, but unfortunately I’m not technically proficient. There is a simpler solution, cranks cranks?

If you are looking to integrate Gravity Forms and Mautic, have a look at WP Mautic Form Integrator https://wordpress.org/plugins/wp-mautic-form-integrator/.

Documentation: http://plugins.hireawiz.com/mautic/1.0/

Once you setup your OAuth 2.0 “code” and “token”, it is smooth sailing.

This is a hidden gem!

Warren

@warrencohn - That plugin is awesome! Great find.

There is now an official Gravity Forms add-on available:

https://gravityplus.pro/gravity-forms-mautic/

@MysticalMatt517 @escopez @regis @Svet Zitrka @warrencohn @gerry

hi any one can help me I feel same prblem
There was an error when trying to integrate with the 3rd party service {mautic} (http://s101.iskcon.net/mautic/form/submit?formId=2).

FORM
Title: CNContact_Form
Intended Recipient: rajnish.kumar@iskcon.net
Source: http://dev.chantnow.com/about-us/

SUBMISSION
Array
(
[timeout] => 10
[body] => Array
(
[mauticform[your_name]] => Rajnish Kumar
[mauticform[your_email_id]] => rajnishkumarrocky@gmail.com
[mauticform[your_message]] => erwertg
[mauticform[formId]] => 2
)

)

RAW RESPONSE
Array
(
[reason] => Could not locate success clause within response
[safe_message] => Success Clause not found
[clause] => Cool!!!
[response] =>

Fatal error: Call to undefined method MauticPluginMauticSocialBundleIntegrationLinkedInIntegration::getAccessToken() in /home/iskcon/public_html/subdomains/S101/mautic/plugins/MauticSocialBundle/Integration/LinkedInIntegration.php on line 103

<title>Site is offline</title>

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" type="image/x-icon" href="/mautic/media/images/favicon.ico" />
<link rel="stylesheet" href="/mautic/media/css/libraries.css" />
<link rel="stylesheet" href="/mautic/media/css/app.css" />

The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.

System administrators, check server logs for errors.

)