[plugin] php script to monitor the number of sent emails

3rd party code for phpList

[plugin] php script to monitor the number of sent emails

Postby H2B2 » 2:35am, Fri 07 Mar, 2008

This script by robidigital (originally from this thread) has been copied here for your convenience:

robidigital, on 05 Jul, 2007 wrote:I created a small php script to check the number of email sent. It does the same thing as the sql query geckoday posted for monitoring. All you have to do is plugin the database settings. Hope this helps.

Code: Select all
//database settings
$dbname = "XXXX";
$dbhost = "XXXX";
$dbuser = "XXXX";
$dbpass = "XXXX";

$dbh=mysql_connect ($dbhost, $dbuser, $dbpass) or die ('I cannot connect to the database because: ' . mysql_error());

$query = "select count(*) FROM phplist_usermessage WHERE messageid=19";

$sendcount = mysql_db_query($dbname,$query);

$mycount = mysql_result($sendcount,0);

echo '<p><strong>' . $mycount . '</strong>&nbsp;mailings have been sent</p>';
Last edited by H2B2 on 11:08pm, Mon 15 Dec, 2008, edited 1 time in total.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

UPDATE 05/22/2008

Postby robidigital » 4:53pm, Thu 22 May, 2008

This one uses a variable to set the message ID you want to track rather than putting it directly into the query string.

Code: Select all
//database settings
$dbname = "XXXX";
$dbhost = "XXXX";
$dbuser = "XXXX";
$dbpass = "XXXX";

$dbh=mysql_connect ($dbhost, $dbuser, $dbpass) or die ('I cannot connect to the database because: ' . mysql_error());

//which message? - set the ID of the message you are sending
$msgid = 29;

//mysql_select_db ($dbname)

$query = "select count(*) FROM phplist_usermessage WHERE messageid=$msgid";

$sendcount = mysql_db_query($dbname,$query);

$mycount = mysql_result($sendcount,0);

echo '<p><strong>' . $mycount . '</strong>&nbsp;mailings have been sent</p>';
robidigital
phpList newbie
 
Posts: 3
Joined: 7:23pm, Tue 30 May, 2006

Postby H2B2 » 8:47pm, Tue 27 May, 2008

Nice improvement on your script robidigital !

Would be nice to have this as a plugin to avoid the need to put database username/password in the script itself.

Anyway, thanks for keeping us up-to-date with your improvements :D
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby CS » 4:45am, Mon 15 Dec, 2008

I decided to go ahead and run this through the Pluginator(TM) to make it easier for all to use. I also beefed it up and streamlined it a bit. Just download the zip from here and unzip it to your plugins directory.

It'll show the number sent for all messages with status of either "inprocess" or "suspended" along with their status, id and subject.
CS
 

Postby H2B2 » 11:08pm, Mon 15 Dec, 2008

Thanks CS!

I'll give it a try as soon as I can find some spare time.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Re: [plugin] php script to monitor the number of sent emails

Postby indidginus » 12:22pm, Mon 19 Apr, 2010

This sounds great - thank you for the download! I've unzipped & uploaded to the plugins directory - now when I send a message to my mailing list, how do I activate the plugin to monitor the sending process? Many thanks.

Michael.
indidginus
PL Nut
 
Posts: 44
Joined: 11:27am, Sun 18 Apr, 2010
Location: Cape Town, South Africa.

Re: [plugin] php script to monitor the number of sent emails

Postby CS2 » 1:24pm, Mon 19 Apr, 2010

Assuming you downloaded my plugin rather than the original script, just click the "message progress" link on the right hand menu.
CS2
PL Master
 
Posts: 216
Joined: 2:20am, Wed 04 Feb, 2009

Re: [plugin] php script to monitor the number of sent emails

Postby indidginus » 8:01pm, Mon 19 Apr, 2010

Hi CS2, thanks for your reply. I did download your zip file..... I don't see the Message Progress link in my admin page though. I ran a test job & the right hand menu doesn't even display (see attached screenshot). I had to refresh the browser & then the Send Message Queue box displayed to tell me all 7 messages had been sent....
Attachments
screenshot.gif
screenshot.gif (23.55 KiB) Viewed 14929 times
indidginus
PL Nut
 
Posts: 44
Joined: 11:27am, Sun 18 Apr, 2010
Location: Cape Town, South Africa.

Re: [plugin] php script to monitor the number of sent emails

Postby CS2 » 1:45pm, Wed 21 Apr, 2010

Looks like there is an error in the PHP somewhere that prevents the processing log from displaying. Do you get this on other pages or only when processing the queue? Also, what version of PHPlist are you running?
CS2
PL Master
 
Posts: 216
Joined: 2:20am, Wed 04 Feb, 2009

Re: [plugin] php script to monitor the number of sent emails

Postby indidginus » 3:43pm, Thu 22 Apr, 2010

Thanks for your reply CS2. I only get that screen when I process the message queue. I'm running 2.10.11. Is there anything I can send you to help get to the bottom of this?
indidginus
PL Nut
 
Posts: 44
Joined: 11:27am, Sun 18 Apr, 2010
Location: Cape Town, South Africa.

Re: [plugin] php script to monitor the number of sent emails

Postby lauraabc » 4:58pm, Mon 24 Oct, 2011

your email counter is super! :P
lauraabc
phpList newbie
 
Posts: 3
Joined: 10:52am, Fri 21 Oct, 2011

Re:

Postby RiTz21 » 1:49am, Thu 18 Apr, 2013

CS wrote:I decided to go ahead and run this through the Pluginator(TM) to make it easier for all to use. I also beefed it up and streamlined it a bit. Just download the zip from here and unzip it to your plugins directory.

It'll show the number sent for all messages with status of either "inprocess" or "suspended" along with their status, id and subject.


I installed this in my 2.10.19 version - works great - THANK YOU!!

RiTz21
RiTz21
phpList newbie
 
Posts: 2
Joined: 1:22pm, Mon 16 Nov, 2009


Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 2 guests

cron