Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduled task #17150

Closed
ngothanhtam opened this issue Jan 27, 2021 · 1 comment
Closed

Scheduled task #17150

ngothanhtam opened this issue Jan 27, 2021 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@ngothanhtam
Copy link

ngothanhtam commented Jan 27, 2021

Scheduled Task seems working once though i setup $this->hourly (It has run once and has stopped)
Must i need to configurate more?

class Tasks extends \Piwik\Plugin\Tasks
{
public function schedule()
{

    $this->hourly('remindMeToLogIn');
}

public function remindMeToLogIn()
{
    $mail = new \Piwik\Mail();
    $mail->setFrom('noreply@xxx.com');
    $mail->addTo('xxxx@gmail.com');
    $mail->setSubject('Check stats');
    $mail->setBodyText('Log into your Matomo instance and check your stats!');
    $mail->send();
}

}

@sgiehl
Copy link
Member

sgiehl commented Jan 27, 2021

Hi @ngothanhtam
Please use our forum for such questions. We usually don't answer questions here.
You can find some details on scheduled tasks here: https://developer.matomo.org/guides/scheduled-tasks
In general tasks are only executed when

  • a archive:cron runs (which will execute the tasks afterwards if not disabled)
  • when browser archiving is enabled: a random visit tracked or a visits to the stats might trigger archiving (which then would trigger the tasks)

@sgiehl sgiehl closed this as completed Jan 27, 2021
@sgiehl sgiehl added the answered For when a question was asked and we referred to forum or answered it. label Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants