├── .editorconfig ├── .gitignore ├── HostnetQueueProgressBundle ├── Config │ └── config.php ├── Controller │ └── QueueProgressController.php ├── HostnetQueueProgressBundle.php ├── Translations │ ├── en_US │ │ └── messages.ini │ └── pt_BR │ │ └── messages.ini └── Views │ └── QueueProgressView │ └── form.html.php └── README.md /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{html,php,phtml}] 15 | indent_size = 4 16 | 17 | [*.{js,json}] 18 | indent_size = 2 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | -------------------------------------------------------------------------------- /HostnetQueueProgressBundle/Config/config.php: -------------------------------------------------------------------------------- 1 | 'Queue Progress', 5 | 'description' => 'Email queue watcher for Mautic.', 6 | 'version' => '2.0.0', 7 | 'author' => 'Hostnet Internet', 8 | 'routes' => [ 9 | 'main' => [ 10 | 'hostnet_queue_progress' => [ 11 | 'path' => '/queueprogress', 12 | 'controller' => 'HostnetQueueProgressBundle:QueueProgress:queueprogress', 13 | ] 14 | ] 15 | ], 16 | 'menu' => [ 17 | 'main' => [ 18 | 'mautic.plugin.queueprogress.title' => [ 19 | 'route' => 'hostnet_queue_progress', 20 | 'id' => 'plugin_hostnet_queueprogress', 21 | 'iconClass' => 'fa-envelope', 22 | 'priority' => -1 23 | ] 24 | ] 25 | ] 26 | ]; 27 | -------------------------------------------------------------------------------- /HostnetQueueProgressBundle/Controller/QueueProgressController.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * @link https://www.hostnet.com.br 7 | * 8 | */ 9 | 10 | namespace MauticPlugin\HostnetQueueProgressBundle\Controller; 11 | 12 | use Mautic\CoreBundle\Controller\CommonController; 13 | use Symfony\Component\HttpFoundation\Request; 14 | use FilesystemIterator; 15 | use GlobIterator; 16 | 17 | class QueueProgressController extends CommonController 18 | { 19 | public function queueprogressAction(Request $request) 20 | { 21 | $spoolPath = $this->factory->getParameter('mailer_spool_path'); 22 | 23 | $emailQuantity = file_exists($spoolPath) 24 | ? (new GlobIterator("$spoolPath/*.message"))->count() 25 | : 0; 26 | 27 | return $this->delegateView([ 28 | 'contentTemplate' => 'HostnetQueueProgressBundle:QueueProgressView:form.html.php', 29 | 'viewParameters' => [ 30 | 'emailQuantity' => $emailQuantity 31 | ] 32 | ]); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /HostnetQueueProgressBundle/HostnetQueueProgressBundle.php: -------------------------------------------------------------------------------- 1 | extend('MauticCoreBundle:Default:content.html.php'); 4 | $view['slots']->set( 5 | 'headerTitle', 6 | $view['translator']->trans('mautic.plugin.queueprogress.title') 7 | ); 8 | ?> 9 | 10 |
16 | =$view['translator']->trans('mautic.plugin.queueprogress.label')?> 17 | | 18 |=$emailQuantity?> | 19 |