PHP Classes

Newsletter Queue: Queue newsletters in MySQL for delivering later

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 65%Total: 3,415 All time: 1,002 This week: 560Up
Version License PHP version Categories
newsletter 0.9GNU General Publi...4.0Email
Description 

Author

This class can be used to queue newsletters in a MySQL database for delivering later.

It can add newsletter messages to a queue that is actually a table in a MySQL database. It stores the message sender, recipient, subject and the body text.

A separate process, eventually started by a task scheduler program like cron, calls the class queries the queue database table to retrieve the details of the messages pending to be delivered.

When a pending message is delivered, the respective database record is removed.

Each run of the delivery process only execute for a limited period of time.

Innovation Award
PHP Programming Innovation award nominee
January 2008
Number 2


Prize: One copy of the Zend Studio
Many sites need to send newsletters to their subscribers.

When the newsletters have many subscribers, it may not be possible to send the messages to all users within the PHP script execution limit. In shared hosting it may also not be possible to increase that limit.

This class implements an alternative solution that consists in storing the newsletter messages and the subscriber e-mail addresses in a MySQL database table.

This way, a PHP script started periodically, for instance by a task scheduler like cron, can take care of the delivery. It sends small batches of newsletter messages, so it does not exceed the PHP execution time limit.

Manuel Lemos
Picture of solomongaby
Name: solomongaby is available for providing paid consulting. Contact solomongaby .
Classes: 10 packages by
Country: Romania Romania
Age: 40
All time rank: 1745 in Romania Romania
Week rank: 215 Down2 in Romania Romania Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files (6)  
File Role Description
Accessible without login Plain text file addMail.php Example example adding a mail in the queue
Plain text file class.newsletter.php Class main class file
Accessible without login Plain text file info.txt Doc. description file
Accessible without login Plain text file newsletter_queue.sql Data sql create table for queue
Accessible without login Plain text file php4_compatibility.txt Doc. php4 compatibility addon
Accessible without login Plain text file queue.php Appl. file trigered by cron

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
Downloadnewsletter-2008-07-06.zip 4KB
Downloadnewsletter-2008-07-06.tar.gz
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
PHPMailer Download .zip .tar.gz used to send e-mails Required
MySQL-class Download .zip .tar.gz conect to mysql DB Required
 Version Control Unique User Downloads Download Rankings  
 0%
Total:3,415
This week:0
All time:1,002
This week:560Up
 User Ratings  
 
 All time
Utility:85%StarStarStarStarStar
Consistency:85%StarStarStarStarStar
Documentation:64%StarStarStarStar
Examples:78%StarStarStarStar
Tests:-
Videos:-
Overall:65%StarStarStarStar
Rank:597