This is a sample plugin built for Mautic 2 (PHP 7.2 required) on the Integrations plugin.
An example for Mautic 3 for the Oauth2 client credentials grant can be found here. An example for Mautic 3 for the Oauth2 authorization code grant can be found here.
This can be used as an example in combination with the Integrations plugin wiki. Note that the Integrations plugin does not work out of the box with Mautic 2 but requires additional installation steps. See the wiki for more information.
This plugin has examples for:
- Plugin migrations
- OAuth2 client credentials client
- Configuration UI interfaces
- Syncing Mautic contacts and companies
The following places have mocked code to simulate a working plugin:
- \MauticPlugin\HelloWorldBundle\Connection\Config::setIntegrationConfiguration()
- \MauticPlugin\HelloWorldBundle\Connection\Client::getClient()
- \MauticPlugin\HelloWorldBundle\Connection\MockedHandler
This plugin also tries to exemplify code standards and expectations.
- Code should be clean (see https://github.com/jupeter/clean-code-php)
- Code should be well covered with unit and/or functional tests
- Code should meet CS standards (includes
symplify/easy-coding-standard
which can be ran withcomposer fixcs
) - Code should pass phpstan standards (run
composer phpstan
)