PHPackages                             escopecz/mautic-form-submit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. escopecz/mautic-form-submit

ActiveLibrary[API Development](/categories/api)

escopecz/mautic-form-submit
===========================

A library for submitting Mautic form from a 3rd pary PHP app

1.1.4(6y ago)5827.3k↓15%14[1 PRs](https://github.com/escopecz/mautic-form-submit/pulls)MITPHPPHP &gt;=5.6.0

Since Apr 25Pushed 1y ago10 watchersCompare

[ Source](https://github.com/escopecz/mautic-form-submit)[ Packagist](https://packagist.org/packages/escopecz/mautic-form-submit)[ RSS](/packages/escopecz-mautic-form-submit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (3)Versions (9)Used By (0)

PHP library for submitting Mautic Form from 3rd party app
=========================================================

[](#php-library-for-submitting-mautic-form-from-3rd-party-app)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/45c8827f9aa8b4c58018df49ad37f9b20464bcdf804e30498596bec637492ea5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6573636f7065637a2f6d61757469632d666f726d2d7375626d69742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/escopecz/mautic-form-submit/?branch=master)[![Build Status](https://camo.githubusercontent.com/61bc5e2556fb7f1cfcabf067e7285761a64b7d813dfa7c7219c34eab02ce0c83/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6573636f7065637a2f6d61757469632d666f726d2d7375626d69742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/escopecz/mautic-form-submit/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/4de11e8be99534b1bf4c0951db00a98ced07736029e61f4bbebcfe08755b9bcd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6573636f7065637a2f6d61757469632d666f726d2d7375626d69742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/escopecz/mautic-form-submit/?branch=master)

Submitting a form can get handy if you want to process the data with your app, but you want to send them to Mautic too. Mautic can then run automated tasks triggered by the form submission. [Read more about it](https://medium.com/@jan_linhart/the-simplest-way-how-to-submit-a-form-data-to-mautic-1454d3afd005) in the original post.

Since the new Mautic versions prefer cookie tracking over IP tracking which makes more tedious to submit the form as the tracked contact, this library will take care of the cookie sending via CURL. It will also listen the cookie from the response and updates the contact cookie with the values from the submit response. This way if the contact ID changes because of contact merge, the contact will continue browsing under the new contact ID.

The automatic cookie handling requires that your form will be on a page tracked by the Mautic JS tracking which provides the Mautic contact cookie in the first place.

Install
-------

[](#install)

### Via Composer

[](#via-composer)

```
composer require escopecz/mautic-form-submit
```

Usage
-----

[](#usage)

```
// Require Composer autoloader
require __DIR__.'/vendor/autoload.php';

// Define the namespace of the Mautic object
use Escopecz\MauticFormSubmit\Mautic;

// Define the namespace of the Mautic configuration object
use Escopecz\MauticFormSubmit\Mautic\Config;

// It's optional to declare the configuration object to change some default values.
// For example to disable Curl verbose logging.
$config = new Config;
$config->setCurlVerbose(true);

// Instantiate the Mautic object with the base URL where the Mautic runs
$mautic = new Mautic('https://mymautic.com');

// Create a new instance of the Form object with the form ID 342
$form = $mautic->getForm(342);

// Submit provided data array to the form 342
$result = $form->submit(['f_email' => 'john@doe.email']);
```

- The integer passed to the `getForm()` method must be ID of the Mautic form.
- The array passed to the `submit()` method must be associative array of `['mautic_field_alias' => 'the_value']`.

For working example see the `examples` dir.

Run project
-----------

[](#run-project)

```
ddev start

```

Project url:

Testing
-------

[](#testing)

```
composer test
composer cs
composer phpstan

```

### Current status

[](#current-status)

[Travis](https://travis-ci.org/escopecz/mautic-form-submit)[Scrutinizer](https://scrutinizer-ci.com/g/escopecz/mautic-form-submit)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 69.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~383 days

Recently: every ~661 days

Total

8

Last Release

627d ago

Major Versions

1.1.4 → 2.0.0-alpha2024-08-29

PHP version history (2 changes)1.0.0PHP &gt;=5.6.0

2.0.0-alphaPHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/06d22001d49de5bbc059225fef93f75581c81c0c814ba453d8f070382328dc9e?d=identicon)[escopecz](/maintainers/escopecz)

---

Top Contributors

[![escopecz](https://avatars.githubusercontent.com/u/1235442?v=4)](https://github.com/escopecz "escopecz (38 commits)")[![9rj](https://avatars.githubusercontent.com/u/9198675?v=4)](https://github.com/9rj "9rj (10 commits)")[![dmelo](https://avatars.githubusercontent.com/u/89710?v=4)](https://github.com/dmelo "dmelo (3 commits)")[![7ochem](https://avatars.githubusercontent.com/u/2794908?v=4)](https://github.com/7ochem "7ochem (2 commits)")[![Hemant-Mann](https://avatars.githubusercontent.com/u/10141396?v=4)](https://github.com/Hemant-Mann "Hemant-Mann (1 commits)")[![tomekkowalczyk](https://avatars.githubusercontent.com/u/39382654?v=4)](https://github.com/tomekkowalczyk "tomekkowalczyk (1 commits)")

---

Tags

mauticphp-libraryMautic

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/escopecz-mautic-form-submit/health.svg)

```
[![Health](https://phpackages.com/badges/escopecz-mautic-form-submit/health.svg)](https://phpackages.com/packages/escopecz-mautic-form-submit)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

92437.3k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
