Skip to content

Sending campaign on server without cron support

edited June 2013 in Suggestions

I would like to show a solution I found to fix my problem.
Since my server do not support Cron. All the time the campaign was freezing every 300/400 sent emails. And I had to reload and click in "continue".
I made this.

In file "app.php":

before the first(line 223):

$(document).ready(function() {

add this:

var _howitwas = "";var _changed = 0;var f_url = $("#continue-sending-text > a:first").data("url");var f_campaign_id = $("#continue-sending-text > a:first").data("id");var f_email_list = $("#continue-sending-text > a:first").data("email_list");var f_app = $("#continue-sending-text > a:first").data("app");var f_offset = $("#continue-sending-text > a:first").data("offset");

And replace the code:

else refresh_interval = setInterval(function(){get_sent_count('.$id.')}, 2000);

for:

else{ if(_howitwas == ""){ _howitwas = data;}else{if(_howitwas == data){_changed++;if( _changed > 10 ){_changed = 0;$.post(f_url, { campaign_id: f_campaign_id, email_list: f_email_list, app: f_app, offset: f_offset },function(a){});}}else{_changed = 0;_howitwas = data;}}refresh_interval = setInterval(function(){get_sent_count('.$id.')}, 2000);}

Done!

Well, it helped me alot :)

Comments

This discussion has been closed.