Jump to content

How to use lazycron?


mel47
 Share

Recommended Posts

Hi,

I read and re-read the page about lazycron but there is something I really don't understand. Where I should put this function? Does the hook and the function should be on the same page? Does the template should be a page related to the function? Or I should create a template specifically for this? But if so, I guess this template have to be published and visited?

My goal is to send an email weekly.

Thanks!
 

Link to comment
Share on other sites

It depends on what you want to achieve but basically with lazycron you specify a time interval target and whenever someone loads a page the lazycron checks if the interval has passed and then triggers its function.

This means that depending on where you put the hook, it may check more often or not: if you put the code in a template, then the lazycron is checked only when a guest is visiting a page with this template. However if you put the hook in init.php (or ready.php) then the lazycron will be checked for every pageview, even the admin ones.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...