Mautic Community Forums

How to embed mautic form in drupal 7

Hi,

Hope you doing great guys…

I am new to Mautic

Can I have example how to integrate mautic form in drupal site.



I don’t have idea how to use “{mauticform id=1 width=300px height=300px}” as code in drupal.



Thanks

Hi,
Hope you doing great guys…
I am new to Mautic
Can I have example how to integrate mautic form in drupal site.

I don’t have idea how to use “{mauticform id=1 width=300px height=300px}” as code in drupal.

Thanks

You can use the javascript code or the iframe option

Thank you for your reply.

Can I have any example of using a Iframe or javascript.

I tried to find but no luck.

Thx

I’d recommend to install https://github.com/mautic/mautic-drupal/tree/7.x and use that.

Thank you escopecz,

Actually I have done all settings required by drupal and mautic but the mautic form is not showing on my drupal when I put this “{mauticform id=ID width=300px height=300px}” in my body content.

I am using ckeditor as a text editor. I tried with plain text, echo php statement but no luck, it just shows the text “{mauticform id=ID width=300px height=300px}” only but no mautic form.

Any Idea why its happening.

The reason this is not working for you is that you need to enable “Use PHP code” as a text format in Drupal. Otherwise Drupal will consider it a security risk and strip it out.

You can enable “PHP filter” in the modules.

Caveat: Make sure you only allow users who know what they are doing to use this!
https://www.drupal.org/documentation/modules/php

Thanks
I did try with php filter but not working.

Finally I one solution to put manually form in our webpage.

See here we can put form manually too. https://www.youtube.com/watch?v=6hJqijNAzkM

As I mentioned in my last message - I’d really rather use a Webform. I see how to do it in the API, and could imagine how it would work in a custom module, but I don’t have time to write that right now.

Fortunately, Zapier to the rescue. There isn’t an official connection yet, but there’s a beta version being worked on you can add to your list via: https://www.mautic.org/community/index.php/254-zapier-integration.

My zap looks like this:

  1. Email Parser by Zapier
    (2. Set up the Drupal webform to send form results over to the Zapier email parser.)
  2. Create / Update a new lead.

It works great so far!

I’m having this problem too, but started by posting an issue over on GitHub. I’ll loop back here/there if we get to a solution.

Enabling PHP Filter in Drupal 6 and 7 is a big no no. It poses a security risk simply having the module enabled and was removed from Drupal 8. Any text format that doesn’t strip HTML (like “Full HTML”) should work just fine. But it doesn’t.

Any other ideas?

The form successfully embeds if I paste the “Automatic” javascript directly into my body field, but the replacement feature of this module is still not working.

I’d really love to find a way to tie this in to webform results…

I embedded a Mautic form in my site by doing this:

First:

  • create a new text format in Drupal with no filtering - just create the text format and save it. No need to enable the PHP filter.

Then:

  • create the form in Mautic
  • copy the JS code from the form
  • create a custom block. Choose the new unfiltered text format.
  • Paste the form code into the block body.
  • place the block on your pages using your preferred method (I use Panels).

I’ve decided that, except for complex webforms, Mautic forms are more than enough for me:

  • The JS embed option means I can modify the form in Mautic and the JS ensures visitors see the new version without me touching the Drupal site.
  • I can use progressive profiling, which I suspect would require considerable coding to make possible in Webform.
  • I don’t have to manually map fields in the webform to fields in Mautic (which is the Mailchimp approach)
  • I don’t have to worry about changes in the Mautic API breaking the Webform integration (e.g. Mailchimp v2, v3, v4 …)
  • I can use this approach in Drupal 8 without worrying about which D8 forms module to use.