Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## Changelog

5.0.1 - 2025-10-10
- Fix markReportAsSent method was missing

5.0.0 - 2025-09-29
- Initial release to send scheduled reports and Custom Alerts to a Slack channel
11 changes: 10 additions & 1 deletion Slack.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,9 @@ public function sendReport(
$subject = Piwik::translate('Slack_PleaseFindYourReport', [$periods[$report['period']], $reportSubject]);
$channelId = $report['parameters'][self::SLACK_CHANNEL_ID_PARAMETER];
$scheduleReportSlack = new ScheduleReportSlack($subject, $filename, $contents, $channelId, $token);
$scheduleReportSlack->send();
if ($scheduleReportSlack->send() && !$force) {
$this->markReportAsSent($report, $period);
}
}

/**
Expand Down Expand Up @@ -503,6 +505,13 @@ private function reportAlreadySent($report, Period $period)
return $previousDate === $period->getRangeString();
}

private function markReportAsSent($report, Period $period)
{
$key = ScheduledReports::OPTION_KEY_LAST_SENT_DATERANGE . $report['idreport'];

Option::set($key, $period->getRangeString());
}

private static function valueIsTrue($value)
{
return $value == 'true' || $value == 1 || $value == '1' || $value === true;
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Slack",
"description": "Send Matomo reports and alerts to Slack channels, keeping your team informed and ready to act in real time.",
"version": "5.0.0",
"version": "5.0.1",
"theme": false,
"require": {
"matomo": ">=5.0.0,<6.0.0-b1"
Expand Down