stats question

Jamie Whittingham

Active Member
Hi @twisted1919

What table should I query to see how many emails were sent today?

is it mw_campaign_delivery_logs

even with the tmp queue feature enabled, do they still get copied over to the mail delivery_logs table after the mail out has completed or do they go somewhere else?

thanks
 
Thanks @twisted1919

Is there a faster way to run the following query

Code:
SELECT count(log_id) AS `total` FROM `mw_campaign_delivery_log` WHERE `date_added` LIKE '2017-04-23%'

It's taking 15 - 20 seconds .....
 
So let me ask you this then ...

I want to run multiple queries like the one above but I'd like to run them via AJAX to speed things up.

Now my Ext is in domain.com/apps/extensions/ext-name/backend/views/file.php

which is not accessable via a HTTP GET command

How would I place ajax.php next to file.php and call it via a standard AJAX url ?

thanks
 
@twisted1919

is 'campaign_delivery_logs' the total sent the delivery server and then MW deducts campaign_bounce_logs to generate its stats? (in other words if I send 10,000 emails then 'campaign_delivery_logs' will have 10,000 records or if 1,000 bounced then only 9,000 would appear in delivery_logs?)
 
So let me ask you this then ...

I want to run multiple queries like the one above but I'd like to run them via AJAX to speed things up.

Now my Ext is in domain.com/apps/extensions/ext-name/backend/views/file.php

which is not accessable via a HTTP GET command

How would I place ajax.php next to file.php and call it via a standard AJAX url ?

thanks
You don't want to do that. You will want to register a controller via your extension and do the ajax call against the controller.

in other words if I send 10,000 emails then 'campaign_delivery_logs' will have 10,000 records
This is it.
 
I didnt see it in the Ext Example
It's there.
PHP:
if ($this->isAppName('backend')) {

            /**
             * Add the url rules.
             * Best is to follow the pattern below for your extension to avoid name clashes.
             * ext_example_settings is actually the controller file defined in controllers folder.
             */
            Yii::app()->urlManager->addRules(array(
                array('ext_example_settings/index', 'pattern'    => 'extensions/example/settings'),
                array('ext_example_settings/<action>', 'pattern' => 'extensions/example/settings/*'),
            ));

            /**
             * And now we register the controller for the above rules.
             *
             * Please note that you can register controllers and urls rules
             * in any of the apps.
             *
             * Remember how we said that ext_example_settings is actually the controller file:
             */
            Yii::app()->controllerMap['ext_example_settings'] = array(
                // remember the ext-example path alias?
                'class'     => 'ext-example.backend.controllers.Ext_example_settingsController',

                // pass the extension instance as a variable to the controller
                'extension' => $this,
            );
        }
 
Back
Top