Thursday, 15 March 2012

php - is cron job what should be used in this case? -



php - is cron job what should be used in this case? -

here 'use case':

admin goes newsletter.php, fills in form email, i.e subject, grouping of users whom email sent, writes message , clicks "send" button.

problem:

the number of emails sent per hr should limited to, let's say, 400. is, 1 email should sent approx. every 10 seconds. besides, sent , not sent emails should tracked.

question:

will cron job trick? the code written in yii framework. possible cron job activated when user clicks on "send" button or in command line? if cron job can things above, can activated in specific action of specific controller? or affects whole script?

thank you

i think have concept of cron job wrong.

think of process way:

admin presses send button.

...that script creates queue i.e. adds email address's etc database table lets phone call queue. , finishes.

you setup cron job run every 5 minutes example.

...the cron starts php script processes x entries queue table, sends emails, removes entries queue table, , stops.

...the cron job starts 1 time again automatically after 5 minutes , repeats process...

all have work out how many emails send in each execution of cron job, , how run it, dont exceed limits or flagged spammer.

php email yii cron

No comments:

Post a Comment