How to create custom plugin in

Hello Am Avinash - @aviboy2006

Software Engineer II @Eagleview India

Open Source Enthusiast | AWS Community Builder

www.avinashdalvi.com | www.internetkatta.com |  

@aviboy2006

Agenda 

  • What is a plugin ?
  • Why is a custom plugin required ?
  • How does it help ?
  • Steps to follow
  • Q/A

www.internetkatta.com |  

@aviboy2006

What are plugins ?

  • It adds extra things other than existing feature or functionality of products.  
  • 👈🏻 Like its shown in image its add extension to switchboard

www.internetkatta.com |  

@aviboy2006

Why its required ?

www.internetkatta.com |  

  • To add extension of existing feature of function
  • If any custom modification required in core files 
  • To integrate third party tools such as mailer, E-commerce or CRM system etc.

@aviboy2006

How does it help ?

www.internetkatta.com |  

  • Keeping safe upgrade
  • Give more Control over functionalities
  • Plugins help you to extend Mautic however you need

@aviboy2006

Steps to follow

www.internetkatta.com |  

  1. Purpose of plugin
  2. Create folder inside "plugins" folder
  3. Create "ExampleBundle.php" file inside "plugins->ExampleBundle"
  4. Create  "Config" folder inside "ExampleBundle"
  5. Create a file "config.php" inside folder "ExampleBundle->Config"

@aviboy2006

Steps to follow

www.internetkatta.com |  

@aviboy2006

<?php 
// plugins/ExampleBundle/ExampleBundle.php

namespace MauticPlugin\ExampleBundle;

use Mautic\PluginBundle\Bundle\PluginBundleBase;

class ExampleBundle extends PluginBundleBase
{
}
<?php
// plugins/ExampleBundle/Config/config.php
return 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( 
    
    )
);

Steps to follow

www.internetkatta.com |  

@aviboy2006

Generic Folder Structure for custom plugin

Tips And Tricks

www.internetkatta.com |  

@aviboy2006

  1. Clear the cache every time you make changes to config.php
  2. If you want to avoid manual work creation of bundle use https://github.com/aviboy2006/mautic-plugin-creator

References 

www.internetkatta.com |  

  • https://www.mautic.org/blog/developer/how-to-create-a-mautic-plugin-tutorial-series-introduction
  • https://www.mautic.org/blog/developer/how-to-create-a-mautic-plugin-step-2/
  • https://developer.mautic.org/#plugins
  • https://www.internetkatta.com/how-to-create-custom-plugin-in-mautic

@aviboy2006

Thank You 

www.internetkatta.com |  

@aviboy2006

You can reach out to me here 👇🏻

@aviboy2006

@aviboy2006

https://www.linkedin.com/in/avinash-dalvi-315b021a/

avinashsdalvi@gmail.com

www.internetkatta.com

Made with Slides.com