Live Sending Status... 'sending x of 685'
Posted: Wed Jul 15, 2009 5:23 am
I'm going to be using swiftmailer to handle the dispatch of email campaigns and newsletters which could potentially be sent to large mailinglists (up to 17000 recipients)
When the message is sent, an ajax callback (jquery incase it interests you) is made posting all relevant variables to the php file which will batch send the message. When the callback is made a 'loading animation' fades in, then 'onSuccess' the script returns the relevant success or failure message to the page and the loading animation fades out.
As the process could take some time to complete I'd like to be able to see a live sending status and I'm just trying to get my head round the best way to achieve this. I thought I'd see if anyone here has done this before or has any suggestions.
Ideally when the process is occuring I'd like to see a status such as 'sending to 4 of 685' which updates in realtime or refreshes every few seconds to show the latest 'sending to 17 of 685' status.
When the message is sent, an ajax callback (jquery incase it interests you) is made posting all relevant variables to the php file which will batch send the message. When the callback is made a 'loading animation' fades in, then 'onSuccess' the script returns the relevant success or failure message to the page and the loading animation fades out.
Code: Select all
$('#LogLoad').fadeIn();$('html, body').animate({scrollTop:0},1000);
$.ajax({url:'PRO_mail.php',type:'POST',datatype:'script',data:$(this).serialize(),success:function(data){
$('#LogResult').html(data);},error:function(){alert('An error occured - please try again!');,
complete:function(){$('#LogLoad').hide();$('#LogResult').fadeIn();RefreshLC();}});
Ideally when the process is occuring I'd like to see a status such as 'sending to 4 of 685' which updates in realtime or refreshes every few seconds to show the latest 'sending to 17 of 685' status.