Thanks for all the help.
Sincerely,
Bryan
www.profitmart101.com
Thanks for all the help.
Sincerely,
Bryan
www.profitmart101.com
For regular newsletters, my vote is for phplist. I found this thread because I'm researching a way to throttle back product notifications. I restock in big batches due to the nature of my business. Right now, I'm about to send a batch but I wanted to know if adding
into the loop would manually slow things. I don't care if it takes all night to process the notifications. I just don't want to anger the customers' hosts and get blocked.PHP Code:sleep(x)
Yes, there is. I have written a program for Zen Cart that I have used for about a couple of months that sits in the Newsletter Manager, and will send out 1 newsletter (email) per X seconds to either all customers or to newsletter subscribers. X can be whatever you like. If X is 8 it sends out 480 emails per hour, perfect for shared host websites. I have added a counter to it, so you can watch it's progress. It's pretty easy to install. The best part is that it pulls directly out the database, eliminating the need to maintain a separate database for emailing or for creating newsletters in an outside program. If there was an interest in this program I will post it as a contribution, as I would very much like to see how more experienced programmers could improve on it.
I regularly have been using it to send out to my list of about 6000, and it seems pretty bullet proof. However, if there was a way to add processing of bounced emails and other features like that it could approach being a full featured bulk email program that sits right in Zen Cart
I'd be glad to make use of this mod. I'm sending 17000 emails, and need to put some delays into the sending ..
At approximately line 108 in the admin/includes/modules/newsletters/newsletter.php file you will find the following:
//force output to the screen to show status indicator each time a message is sent...
if (function_exists('ob_flush')) @ob_flush();
@flush();
$audience->MoveNext();
}
I changed mine to this:
//force output to the screen to show status indicator each time a message is sent...
if (function_exists('ob_flush')) @ob_flush();
@flush();
// Delay code to slow emails
zen_set_time_limit(60); //reset timeout limit to avoid timeouts in long email sends
// Delay time calculation is number of seconds in between email sends. 3600 seconds divide 80% of server email limit.
sleep(3600/(350 * 0.8)) ;
$audience->MoveNext();
}
There are other ways to approach this with setting the 250 emails per hour as a variable instead of a hard coded number. Test it on a smaller batch to start with to make sure you get it right before you send off 1000's of email and blow the server limits. This example should result in approximately 280 emails per hour leaving overhead for 70 normal outgoing and incoming messages an hour.
NOTE: Not all servers can handle that.
ie: some hosts prevent altering the timeout limit or setting it higher than a certain value
ie: some hosts have scripts set up to kill scripts that run longer than the threshold set
ie: many hosts will lose their database connection during such a long activity time, or will flag your application as taking too long to complete or using too much database/CPU time.
That said, if it works for you, great ... but if someone tries it and it doesn't suit them, at least they've been warned![]()
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.