Results 1 to 23 of 23

Thread: Newsletter Scheduling

  1. #1
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Newsletter Scheduling

    Has anyone found a way to handle newsletter scheduling without having to use CRON jobs and a german newsletter module? Already posted to the dev. forums for this feature, and Leo replied that it would be difficult to implement because of the way the messages are sent.

    Anyone have a custom newsletter module in the works that does this (in English)?

  2. #2
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Newsletter Scheduling

    Like said before; it is impossible te send the newsletter at a preset time without a cronjob. The other solutions are triggered on a request to the server. So they require an outside trigger; mostly a user visiting a page. If not crontabs then you need help from the outside to open the image that runs the "cron" triggered by the extension. Crontabs are relatively easy, what is the problem with that german extension?

  3. #3
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Newsletter Scheduling

    #1 It's in German...

    #2 Cron scheduling is not ideal for an end user to setup or make adjustments to

    only if condition 1 = English can condition 2 be acceptable temporarily.

    Just the way it has to be for this module to work in this project. It's not my call...

    EDIT:
    The thing that sucks about this is that the Newsletter is one of the key features of this site and the end-user requires automation of the module. I've spent over 3 months developing this project in Contao... and I DO NOT want to see it thrown in the pit because of this issue.

  4. #4
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Newsletter Scheduling

    Hi Mechaflash.
    You NEED some sort of cron, whether its Contaos, one set up on your server, your Aunty paid to stay up all night and visit the website at a particular time, or an online cron service.
    This is because any script has to be executed, and it is executed by a visit to it.

    Contaos is really a pseudo-cron, as it is triggered by the first website page hit after the time you set for it (no site visitor for 4 hours means the cron will be 4 hours late) so is not reliable, nor is your Aunty ( no offence to her - but between you and me I've heard she drinks a bit :shock: )

    You can write/have written a script that, when triggered, sends a newsletter - and place it in the Templates folder.
    You can translate/have translated the German module into Engish.

    But you still need the trigger.
    An online service may be an option to look at, also check the repository for a module by Acenes to do with Cron (i remember one vaguely), or hunt for any scripts online that look like they might make setting up a cron easier for the client. They will have to match your server operating system (eg a php script for a Unix Cron). Potentially a good one (IF they exist) could be the basis for a scheduling module.

    I'd suggest working out your trigger method before working out what is being triggered.

  5. #5
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Newsletter Scheduling

    Just a quick question; does the sending of the newsletter allow for automation in the first place? I've never used it to actually send a newsletter, but I think it requires javascript? Or is that what the german extension is for; adding the option to send without a script... Mecha, you are going to have to translate it in that case, not too hard.

    Quote Originally Posted by mechaflash
    The thing that sucks about this is that the Newsletter is one of the key features of this site and the end-user requires automation of the module.
    Is the type of automation discussed? You only need to setup the crontab ones. You can set the crontab to run every hour but instead of sending the newsletter you can have it load the cron.php of the contao cron extension. This way that is triggered at least ones each hour, and even more often because of normal pageviews. Configure the cron extension from within Contao as normal, being sure to mention that nightly runs are at least precise up to the hour. (Or a shorter interval depending on what you set (I wouldn't go much shorter then 15min))

    Quote Originally Posted by mechaflash
    I've spent over 3 months developing this project in Contao... and I DO NOT want to see it thrown in the pit because of this issue.
    No pun intended; you had to think of that 3 months earlier. But in this case it really does not matter if you had used Contao, Joomla, TYPO3 or *the perfect CMS*. You need a real crontab/online "cron" service to trigger the event.

  6. #6
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Newsletter Scheduling

    does the sending of the newsletter allow for automation in the first place?
    I assumed so, maybe not (I haven't looked) but as all details are databased and there is an email class, a script to do it from Templates should be possible (and cron would target this directly).

    I think Mechaflash is after a solution where the time/period of the cron can be easily changed by the client.

  7. #7
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Newsletter Scheduling


  8. #8
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Newsletter Scheduling

    Quote Originally Posted by ramjet
    does the sending of the newsletter allow for automation in the first place?
    I assumed so, maybe not (I haven't looked) but as all details are databased and there is an email class, a script to do it from Templates should be possible (and cron would target this directly).
    I looked it up and it seems that the send function can send a configurable amount of emails per call. The argument it takes must be a DataContainer, and should contain member id (for newsletter id) and the other information it takes from GET variables.

    So an addition should be made, short and simple extension that first figures out if a newsletter must be sent. The cron runs at a preset time; add a field to the newsletter for automated sending date/time and send the newsletter if unsent and time/date is in the past. Perhaps add a checkbox "enabled" to ensure newsletters aren't sent by accident. When sending the extension must add variables to the GET array to make it work. You should specify the amount of emails you want to send per batch (mpc) and the offset (start) on each call.

    You also need to check if you won't run into any problems using this method; you may run into a limit on the mail function (that avoids spammers from using it) or you can hit the maximum execution time of your php script. I think these are the reasons why Contao sends a specific nr of newsletters per call to the function and then reloads the page for the next batch. You cannot simulate that with the cron unless you make the algorithm more complex so it knows how many and which recipients where in the last batches for the same newsletter.

  9. #9
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Newsletter Scheduling

    Would a ping to the web server work to activate the contao cron job?

  10. #10
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Newsletter Scheduling

    I don't know much about PHP and I don't know how to program modules... can the cron scheduling be done with the pre-packaged Newsletter? If so what php function has to be called from the cron? If aviosta is the only solution, which php function has to be called from the cron from that module? I'll just translate the module when I get time.

    Thanks for your help

  11. #11
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Newsletter Scheduling

    I was reading the features as described here in German: http://www.contao-community.de/showthre ... ttersystem. It says email can be sent via cronjob, so I guess it is configurable.

    However, that feature is the pseudo cron, that won't work after a ping. It will work if you open TL_ROOT/cron.php.
    Alternatively you could set up a real cronjob to open cron.php each hour. That way the contao pseudo cron.php becomes an almost real cron. You can then configure it from contao without needing a second tool (other then setting up the intial real cron)

  12. #12
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Newsletter Scheduling

    Quote Originally Posted by Ruud
    However, that feature is the pseudo cron, that won't work after a ping. It will work if you open TL_ROOT/cron.php.
    So use the server to touch on cron.php and it will activate the cron job?

    Also, what does the CRON target specifically in the module to setup the cron schedule?

    And if you know how, I noticed that Avisota has English in the language folder... is it possible that the module is defaulting to German and there's a way to switch it to English?

    Thanks Ruud/Ramjet :D

  13. #13
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Newsletter Scheduling

    Why don't you try and find out about the english? I assume the en folder means english is available.

    Touching a file probably won't do anything. Your target is to run the script, instead of doing a file operation.

    About the contao cron; try it out. I've used it ones and it was easy to setup.

  14. #14
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Newsletter Scheduling

    I noticed that Avisota has English in the language folder... is it possible that the module is defaulting to German and there's a way to switch it to English?
    No. If you have a look at all the files in the Engish folder (languages/en) you'll see they are in German.
    No-one has translated this module yet, but its all there if you want to get out your phrasebook!
    Open them, put each phrase into Google Translate, and you'll be halfway there.
    Unless you do this (or learn German) its a bit hard to see whats going on in the module.

    So use the server to touch on cron.php and it will activate the cron job?
    Probably not. You cannot Crontab the default Newletter Module.
    Avisota probably has a setting.
    A real server Crontab will just need to target any frontend page of your website (eg home.html) every hour - as Ruud said, to make the Contao Periodic Command Scheduler(PCS or Cron) trigger more reliably.

    This is an example of what a server Crontab might require as commands (it depends on your server)
    05 * * * *
    /hsphere/shared/php5/bin/php /hsphere/local/home/myAccount/myDomain.com/home.html
    meaning 5 minutes past the hour, every hour, every day, every month, every day of the week - full server path to php - full server path of the page to hit

  15. #15
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Newsletter Scheduling

    Working on the translation right now. Google Translate helps quite a bit, but a lot of cleaning up required for the shoddy translations it renders :lol:

  16. #16
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Newsletter Scheduling

    not sure what to do from here...

  17. #17
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Newsletter Scheduling

    targeted ../system/modules/Avisota/Avisota.php unless I'm doing this wrong?

  18. #18
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Newsletter Scheduling

    I can't really help, as I don't know German and haven't used the Avisota module ... or the Cron one.
    Can you zip your translated files and post them here? and maybe describe a bit more about what you're doing to get this error. (i take it this error is from Acenes's [cron] module)

  19. #19
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Newsletter Scheduling

    those are all the translated files that go into the EN language folder for Avisota. It will automatically load the en language when you refresh. It took a few hours to do it, had to go back and edit many of the google translations. Some instances may be innacurate as I haven't gotten down to every little detail yet. But it's all translated.

    PLEASE NOTE: Some of the files were edited with my admin email, so if you're going to reuse it, please change that first =D thanks!

  20. #20
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Newsletter Scheduling

    Did you solve the cron problem, not targeting the correct file. What you did seems wrong in any case. My guess is you'd need to go through index.php with certain parameters?

    Some more bad news: http://www.contao-community.de/showthre ... #post88628 It says that in september last year the cron script didn't actually exist yet. I'm not sure it does now. So you may be in for some additional work

    Perhaps ask in the German Avisota forum. I've done it on some occasions using both English and a half ass German translation I wrote myself. Worked every time and I even got some German sentences correct from the beginning to the end.

  21. #21
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Newsletter Scheduling

    i think I'm gonna cry now... be back later :cry:

  22. #22
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Newsletter Scheduling

    Hmmmm, had a quick look with your English translation.
    There doesn't seem to be implementation of timed jobs in the module.
    Funny, I thought I read somewhere that there was.

    I think you're best to try to talk directly to the developer and ask what when why .... I'm sure he'll appreciate the translation so you'll have brownie points (theres three language file missing translations ... tl_avisota_translation,tl_avisota_recipient_import ,default.php).

    I haven't used Avisota, do you find it better than Newsletter for your needs (apart from the obvious one of Cron)

    What is the link to your ticket to Leo re implementing this in Newsletter?

  23. #23
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Newsletter Scheduling

    Quote Originally Posted by mechaflash
    i think I'm gonna cry now... be back later :cry:
    I have no idea why one would mention the extension has cron when it is on the todo list....

    But you'd be best off now if you digg into it. sending emails and all is already in, Avisota has some methods for sending. You should be able to create the script....

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •