Stats email: display clicked in the first row and opened in the second

This commit makes some changes to the stats email. It displays just the
clicked stats in the first row and it moves the opened stats to the
second row. It also adds machine-opens alongside opens in the second
row.

[MAILPOET-3324]
This commit is contained in:
Rodrigo Primo
2022-01-27 17:50:04 -03:00
committed by Veljko V
parent 3700af261f
commit a43fd34f7d
2 changed files with 87 additions and 47 deletions

View File

@@ -136,6 +136,7 @@ class Worker {
$statistics = $this->newsletterStatisticsRepository->getStatistics($newsletter);
$clicked = ($statistics->getClickCount() * 100) / $statistics->getTotalSentCount();
$opened = ($statistics->getOpenCount() * 100) / $statistics->getTotalSentCount();
$machineOpened = ($statistics->getMachineOpenCount() * 100) / $statistics->getTotalSentCount();
$unsubscribed = ($statistics->getUnsubscribeCount() * 100) / $statistics->getTotalSentCount();
$subject = $sendingQueue->getNewsletterRenderedSubject();
$subscribersCount = $this->subscribersRepository->getTotalSubscribers();
@@ -153,6 +154,7 @@ class Worker {
'linkStats' => WPFunctions::get()->getSiteUrl(null, '/wp-admin/admin.php?page=mailpoet-newsletters&stats=' . $newsletter->getId()),
'clicked' => $clicked,
'opened' => $opened,
'machineOpened' => $machineOpened,
'subscribersLimitReached' => $this->subscribersFeature->check(),
'hasValidApiKey' => $hasValidApiKey,
'subscribersLimit' => $this->subscribersFeature->getSubscribersLimit(),