chore: complete update
This commit is contained in:
41
src/Infrastructure/Api/RapidMail/StatisticsService.php
Normal file
41
src/Infrastructure/Api/RapidMail/StatisticsService.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Infrastructure\Api\RapidMail;
|
||||
|
||||
use App\Framework\Http\Method;
|
||||
|
||||
final readonly class StatisticsService
|
||||
{
|
||||
public function __construct(
|
||||
private RapidMailApiClient $apiClient
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Holt Statistiken für ein Mailing
|
||||
*/
|
||||
public function getMailingStats(int $mailingId): array
|
||||
{
|
||||
return $this->apiClient->request(
|
||||
Method::GET,
|
||||
"mailings/{$mailingId}/stats",
|
||||
[],
|
||||
$this->apiClient->getDefaultQueryParams()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Holt Klick-Statistiken für ein Mailing
|
||||
*/
|
||||
public function getClickStats(int $mailingId): array
|
||||
{
|
||||
return $this->apiClient->request(Method::GET, "mailings/{$mailingId}/stats/clicks");
|
||||
}
|
||||
|
||||
/**
|
||||
* Holt Öffnungs-Statistiken für ein Mailing
|
||||
*/
|
||||
public function getOpenStats(int $mailingId): array
|
||||
{
|
||||
return $this->apiClient->request(Method::GET, "mailings/{$mailingId}/stats/opens");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user