How to create custom plugin in Mautic

  • Keeping safe upgrade
  • Give more Control over functionalities
  • Plugins help you to extend Mautic however you need
  • Purpose of plugin : Decide name and purpose of plugin so that you can use the same in plugin name and folder structure while creating in Mautic. If you are creating for third party integration then specify the same else if you’re extending Mautic existing functionality like adding extra UI components or customising of UI elements etc.
  • Create a folder inside the plugins folder. Let's take an example: you are going to create a plugin named ExampleBundle. So create a folder with the same name folder.
  • Create ExampleBundle.php file inside plugins->ExampleBundle. Copy below code in file.
<?php 
namespace MauticPlugin\ExampleBundle;
use Mautic\PluginBundle\Bundle\PluginBundleBase;class ExampleBundle extends PluginBundleBase
{
}
?>
  • Create a Config folder inside ExampleBundle. Then create a file config.php inside the folder ExampleBundle->Config. Copy below code and make changes accordingly.
<?php// plugins/ExampleBundle/Config/config.phpreturn array(
'name' => 'ExampleBundle',
'description' => 'Add here description of plugin',
'author' => 'Avinash Dalvi', // Change this to plugin author
'version' => '1.0.0', // Change this version to your appropriate version
'routes' => array(
)
);
  • Folder structure will look like below. Other folders are as per customisation which you would like to do.
  • For the icon of the plugin keep the icon image in either .png or .jpeg format under Assets/img if the folder is not there then create an Assets/img folder and copy the image file there.
  • Run php bin/console cache:clear to clear Mautic cache.
  • Go Mautic website link -> Setting (Right hand side top setting icon ) -> Plugins
  • Click on “Install/Upgrade Plugins” then it will reflect the plugin icon along with name.
  • For overriding existing Controller/Event follow Symfony framework override guideline .
  • Third party lead management system integration like Dialer system, Landing page form etc.
  • Changing default unique parameter while importing or creating lead in Mautic
  • Customisation of process flow like addition of extra flow in automated flow.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store