Skip to content
Snippets Groups Projects
Commit 6466ea05 authored by Balint Pekker's avatar Balint Pekker Committed by Brady
Browse files

Issue #3299971: Remove changes not related to D10 compatibility

parent 00d45d24
No related branches found
No related tags found
3 merge requests!30Issue #2971991 by amykhailova, code-drupal: "Cc" Recipient not receiving email...,!25Issue #2979620 by Baik Ho: 400 Bad Request - Handle exception returned from...,!17Issue #3299971: Drupal 10 compatibility
......@@ -278,11 +278,6 @@ class Api {
return [];
}
// Get config.
$config = $this
->configFactory
->get('sendgrid_integration_reports.settings')
->get();
// Set start date and end date for global stats - default 30 days back.
$start_date = empty($config['start_date']) ? date('Y-m-d', strtotime('today - 30 days')) : $config['start_date'];
$end_date = empty($config['end_date']) ? date('Y-m-d', strtotime('today')) : $config['end_date'];
......@@ -296,14 +291,14 @@ class Api {
];
// Lets try and retrieve the browser statistics.
$stats_data = $this->getResponse($path, $query);
$statsdata = $this->getResponse($path, $query);
if (!$stats_data) {
return [];
}
$data = [];
// Determine all browsers. Nested foreach to
// iterate over all data returned per aggregation.
foreach ($stats_data as $item) {
foreach ($statsdata as $item) {
foreach ($item->stats as $inneritem) {
if (array_key_exists($inneritem->name, $data)) {
$data[$inneritem->name] += $inneritem->metrics->clicks;
......@@ -334,11 +329,6 @@ class Api {
return FALSE;
}
// Get config.
$config = $this
->configFactory
->get('sendgrid_integration_reports.settings')
->get();
// Set start date and end date for global stats - default 30 days back.
$start_date = empty($config['start_date']) ? date('Y-m-d', strtotime('today - 30 days')) : $config['start_date'];
$end_date = empty($config['end_date']) ? date('Y-m-d', strtotime('today')) : $config['end_date'];
......@@ -353,14 +343,14 @@ class Api {
];
// Lets try and retrieve the browser statistics.
$stats_data = $this->getResponse($path, $query);
$statsdata = $this->getResponse($path, $query);
if (!$stats_data) {
return [];
}
$data = [];
// Determine all browsers. Nested foreach to
// iterate over all data returned per aggregation.
foreach ($stats_data as $item) {
foreach ($statsdata as $item) {
foreach ($item->stats as $inneritem) {
if (array_key_exists($inneritem->name, $data)) {
$data[$inneritem->name] += $inneritem->metrics->opens;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment