Skip to content

Commit

Permalink
Check error notifications on email (no storage space) #795
Browse files Browse the repository at this point in the history
  • Loading branch information
jorikfon committed Sep 23, 2024
1 parent cf85796 commit d9e81f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Core/System/Notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ public static function sendAdminNotification(string $subject, array $messages, b
if(!$di){
return;
}
$adminMail = PbxSettings::getValueByKey(PbxSettingsConstants::SYSTEM_NOTIFICATIONS_EMAIL);

$managedCache = $di->getShared(ManagedCacheProvider::SERVICE_NAME);
$cacheKey = 'SendAdminNotification:' . md5($subject . implode('', $messages));
$cacheKey = 'SendAdminNotification:' . md5($adminMail. $subject . implode('', $messages));
$cacheTime = 3600 * 24; // 1 day

// Check if the message is not urgent and has been sent recently from cache.
Expand All @@ -108,7 +110,6 @@ public static function sendAdminNotification(string $subject, array $messages, b
$text = str_replace(PHP_EOL, '<br>', $text);

// Get the admin email address from PbxSettings.
$adminMail = PbxSettings::getValueByKey(PbxSettingsConstants::SYSTEM_NOTIFICATIONS_EMAIL);
$notify = new Notifications();
$result = $notify->sendMail($adminMail, $subject, trim($text));

Expand Down

0 comments on commit d9e81f0

Please sign in to comment.