Scenario:
- Clicking “Send report” it sends the report to the email
-
Daily automatic reports are NOT send
a) Piwik 1.2
b) Archives automatic, triggered with the browser [ie. archive.sh not used]
c) 1 daily report
INSERT INTOprefix_pdf
(idreport
,idsite
,login
,description
,period
,email_me
,additional_emails
,reports
,ts_created
,ts_last_sent
,deleted
) VALUES
(1, 1, ‘admin’, ‘daily’, ‘day’, 1, ‘myemail1@gmail.com’, ‘UserSettings_getBrowser,UserSettings_getBrowserType’, ‘2011-03-06 12:10:20’, ‘null’, 0);
In ts_last_sent tried with null and also with 2011-03-06 12:10:20.
I have been digging today and found the following:
Editing tmp/cache/tracker/general.php, I put “lastTrackerCronRun” 86400 seconds less to keep forcing the crons
Putting a flag in function getScheduledTasks ( $notification ){
// my flag here
$myFile = “/home/mydomain/piwik/tmp/cache/tracker/flag_getschedule.txt”;
$fh = fopen($myFile, ‘w’);
fwrite($fh, ‘ok’);
fclose($fh);
// end flag
It creates the flag_getschedule.txt, so routine reaches that function.
However I think the routine ends here not going ahead to send the email
$tasks[] = new Piwik_ScheduledTask ( $this, ‘dailySchedule’, $dailySchedule );
Putting the following flag, I can’t have any response
function dailySchedule()
{
// my flag here
$myFile = “/home/mydomain/piwik/tmp/cache/tracker/flag_dailyschedule.txt”;
$fh = fopen($myFile, ‘w’);
fwrite($fh, ‘ok’);
fclose($fh);
// end flag
$this->generateAndSendScheduledReports(‘day’);
}