SugarCRM - Synolab

SugarCRM – How to monitor your Email Manager Queue with Sugar CLI

Par Cédric M. le 22 août 2016

 Lecture 2 minutes

Since the Sugar 7.7.1.0 version, SugarCRM introduces a Sugar CLI tool based on Symfony Console. This Sugar CLI tool is under beta version at this moment (August 2016) and can be changed in the future.

We will see in this article how to use this new Sugar CLI to add a command which provides some statistics from the Email Manager Queue. We want to display how many emails by campaign by module are waiting to be send.

The first step is to define the Command itself

To perform this operation we implement

because our command must be executed only on installed Sugar instance. The only require thing to do that is to describe the command name, the description and the help on the configure() method and to implement our logic in the execute() method. We are using a SugarQuery to retrieve the data and to display the result through a table. We can imagine to externalize this part and use it in an API and unit test it.

Declare the Command

Now we need to set this command available by using the application/Ext/Console framework:

Add our namespace

To use our own namespace we can follow one of the way describe in our previous article by using the application/Ext/Utils framework:

Perform a Quick Repair and Rebuild et voilà !

 

How to monitor your Email Manager Queue with Sugar CLI

Thanks to Jelle Vink about his presentation of this new Sugar CLI tools at the Uncon 2016

You can find more information about Sugar CLI on the Sugar Developer Guide

Twitter LinkedIn Facebook E-mail
Cédric M.

Quand l'aPHPétit va tout va !

GIF