Sending Mails using a Cronjob
- Chris
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 36
- Thank you received: 3
8 months 2 weeks ago #1
by Chris
Cheers, Chris
Sending Mails using a Cronjob was created by Chris
Hi Christopher,
I am new to NS Pro and have been using Acymailing so far. I wanted a change and have bought NS Pro. I'm still playing around and have so far managed to import subscribers from Acy, and managed to send some test mails to a specific test list.
My hoster does not allow to send to many mails/hour, which means I have to restrict to 4*25 mails per hour (every 15mins 25 mails). I want to use my own cron job to obtain this goal and have generated a key and downloaded your script. The script lives in the root of my site and cron sends me a mail every 5mins (as set up) with some html gibberish, but a scheduled mail does not get sent. Neither does calling the script from the browser work.
It seems to me nspro_trigger_for_clients.php does not do what I think it should do. The only thing I can do to set it up, is giving it the right url to the web site.
So here's my question: How can I make NS Pro to send 25 mails every 15 minutes?
Cheers, Chris
I am new to NS Pro and have been using Acymailing so far. I wanted a change and have bought NS Pro. I'm still playing around and have so far managed to import subscribers from Acy, and managed to send some test mails to a specific test list.
My hoster does not allow to send to many mails/hour, which means I have to restrict to 4*25 mails per hour (every 15mins 25 mails). I want to use my own cron job to obtain this goal and have generated a key and downloaded your script. The script lives in the root of my site and cron sends me a mail every 5mins (as set up) with some html gibberish, but a scheduled mail does not get sent. Neither does calling the script from the browser work.
It seems to me nspro_trigger_for_clients.php does not do what I think it should do. The only thing I can do to set it up, is giving it the right url to the web site.
So here's my question: How can I make NS Pro to send 25 mails every 15 minutes?
Cheers, Chris
Cheers, Chris
Please Log in or Create an account to join the conversation.
- Chris
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 36
- Thank you received: 3
8 months 2 weeks ago #2
by Chris
Cheers, Chris
Replied by Chris on topic Sending Mails using a Cronjob
On second though, I have to correct myself: Mails seem to get sent in the end, but I strongly suspect, the sending process is triggered by your service. That's not what I intended....
Cheers, Chris
Please Log in or Create an account to join the conversation.
- Christopher Mavros
-
- Offline
- Administrator
-
8 months 2 weeks ago #3
by Christopher Mavros
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Replied by Christopher Mavros on topic Sending Mails using a Cronjob
Hello Chris and thank you for posting.
First of all, welcome aboard. NS Pro is much simpler and Joomla oriented than Acymailing. Some tasks are accomplished differently, but once you get the hang of it, it's a lot easier to manage and get the job done.
The most common way to trigger NS Pro sending is through our service. I disabled the trigger for your website now, but as far as I can see, it didn't work through our trigger, because it mentioned a wrong Cron job key.
This makes sense, because our key system differs when you use your own script and when you use our service. The key produced when you chose the "Only Generate Key" was only meant to be used for your own script.
Since you want to use the script, you have control over the specified key and the URL you want to trigger. If you need help with the generated key, I can explain further.
The script only triggers the install NS Pro, the same way as our service does. You ought to set up your own cron job task to run every 5 or 15 minutes - whichever you prefer. I guess you already accomplished that.
To test if the script works, you can just trigger its URL. Since you placed it in your root directory, that would be yoursite.com/nspro_trigger_for_clients.php or whatever you change the script name to.
To actually see if it NS Pro is triggered and sends emails, you can also access the Sending Log from the back-end.
Then, NS Pro allows you to control the "Emails Per Send". This is a simple integer number of emails to send every time a sending is triggered. If you want 25 emails per 15 minutes, you set your cron job to run every 15 minutes and set the Emails per Send to 25. Even better, you can set it to 24 or less, in order to leave a margin for your other emails, such as contact forms, etc.
Let me know if that helps or if you need further assistance!
First of all, welcome aboard. NS Pro is much simpler and Joomla oriented than Acymailing. Some tasks are accomplished differently, but once you get the hang of it, it's a lot easier to manage and get the job done.
The most common way to trigger NS Pro sending is through our service. I disabled the trigger for your website now, but as far as I can see, it didn't work through our trigger, because it mentioned a wrong Cron job key.
This makes sense, because our key system differs when you use your own script and when you use our service. The key produced when you chose the "Only Generate Key" was only meant to be used for your own script.
Since you want to use the script, you have control over the specified key and the URL you want to trigger. If you need help with the generated key, I can explain further.
The script only triggers the install NS Pro, the same way as our service does. You ought to set up your own cron job task to run every 5 or 15 minutes - whichever you prefer. I guess you already accomplished that.
To test if the script works, you can just trigger its URL. Since you placed it in your root directory, that would be yoursite.com/nspro_trigger_for_clients.php or whatever you change the script name to.
To actually see if it NS Pro is triggered and sends emails, you can also access the Sending Log from the back-end.
Then, NS Pro allows you to control the "Emails Per Send". This is a simple integer number of emails to send every time a sending is triggered. If you want 25 emails per 15 minutes, you set your cron job to run every 15 minutes and set the Emails per Send to 25. Even better, you can set it to 24 or less, in order to leave a margin for your other emails, such as contact forms, etc.
Let me know if that helps or if you need further assistance!
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Please Log in or Create an account to join the conversation.
- Chris
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 36
- Thank you received: 3
8 months 2 weeks ago - 8 months 2 weeks ago #4
by Chris
Cheers, Chris
Replied by Chris on topic Sending Mails using a Cronjob
Thanks, Christopher for getting back to me. Well, it seems to me that your sript still sticks to a 30 minutes schedule even though my cron runs every 15 minutes. I believe it's because of
I commented this out and the script is triggered as expected.
Code:
// small patch to trigger only half the sites every 15 minutes ;) if (date('i') < 15) { $i = 1; } else if (date('i') < 30) { $i = 0; } else if (date('i') < 45) { $i = 1; } else { $i = 0; }
I commented this out and the script is triggered as expected.
Cheers, Chris
Last edit: 8 months 2 weeks ago by Chris.
Please Log in or Create an account to join the conversation.
- Christopher Mavros
-
- Offline
- Administrator
-
8 months 2 weeks ago #5
by Christopher Mavros
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Replied by Christopher Mavros on topic Sending Mails using a Cronjob
Ah, right. That part isn't necessary for users. Thanks for bringing that up!
Let me know if anything else comes up!
Let me know if anything else comes up!
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
The following user(s) said Thank You: Chris
Please Log in or Create an account to join the conversation.
Moderators: Christopher Mavros