diff --git a/app/Console/Commands/Services/Tasks/NotifyAlarms.php b/app/Console/Commands/Services/Tasks/NotifyAlarms.php
index 540686b6..207531c0 100644
--- a/app/Console/Commands/Services/Tasks/NotifyAlarms.php
+++ b/app/Console/Commands/Services/Tasks/NotifyAlarms.php
@@ -61,13 +61,13 @@ class NotifyAlarms
switch ($alarm_level_id) {
case 1:
- $message = '
ALARM LEVEL '.$alarm_level_id.'
';
+ $message = 'ALARM LEVEL '.$alarm_level_id;
break;
case 2:
- $message = 'ALARM LEVEL '.$alarm_level_id.'
';
+ $message = 'ALARM LEVEL '.$alarm_level_id;
break;
default:
- $message = 'ALARM LEVEL '.$alarm_level_id.'
';
+ $message = 'ALARM LEVEL '.$alarm_level_id;
break;
}
$tablecontent = [
@@ -81,7 +81,7 @@ class NotifyAlarms
];
Mail::to($user)
- ->send(new AlarmNotification($message, $tablecontent));
+ ->send(new AlarmNotification($message, $tablecontent, $alarm_level_id));
}
$stored_alarms[] = $send;
diff --git a/app/Mail/AlarmNotification.php b/app/Mail/AlarmNotification.php
index 4b5a59cd..d378485b 100644
--- a/app/Mail/AlarmNotification.php
+++ b/app/Mail/AlarmNotification.php
@@ -16,14 +16,16 @@ class AlarmNotification extends Mailable
protected array $tablecontent;
+ protected int $alarm_level_id;
+
/**
* Create a new message instance.
*/
- public function __construct($message, $tablecontent)
+ public function __construct($message, $tablecontent, $alarm_level_id)
{
$this->message = $message;
-
$this->tablecontent = $tablecontent;
+ $this->alarm_level_id = $alarm_level_id;
}
/**
@@ -46,6 +48,7 @@ class AlarmNotification extends Mailable
with: [
'tablecontent' => $this->tablecontent,
'message' => $this->message,
+ 'alarm_level_id' => $this->alarm_level_id,
],
);
}
diff --git a/resources/views/mail/user/alarm.blade.php b/resources/views/mail/user/alarm.blade.php
index 347c548b..12c54470 100644
--- a/resources/views/mail/user/alarm.blade.php
+++ b/resources/views/mail/user/alarm.blade.php
@@ -1,86 +1,81 @@
-
-
-
-
- NUH-Odds
-
-
+
-
-
-
-
-
- | NUH-Odds Alarm Monitoring
- |
-
-
- |
- {{ $message }}
- |
-
-
-
-
- |
- {{ $tablecontent[0]['key'] }}
- |
-
- {{ $tablecontent[0]['value'] }}
- |
-
-
- |
- {{ $tablecontent[1]['key'] }}
- |
-
- {{ $tablecontent[1]['value'] }}
- |
-
-
- |
- {{ $tablecontent[2]['key'] }}
- |
-
- {{ $tablecontent[2]['value'] }}
- |
-
-
- |
- {{ $tablecontent[3]['key'] }}
- |
-
- {{ $tablecontent[3]['value'] }}
- |
-
-
- |
- {{ $tablecontent[4]['key'] }}
- |
-
- {{ $tablecontent[4]['value'] }}
- |
-
-
- |
- {{ $tablecontent[5]['key'] }}
- |
-
- {{ $tablecontent[5]['value'] }}
- |
-
-
- |
- {{ $tablecontent[6]['key'] }}
- |
-
- {{ $tablecontent[6]['value'] }}
- |
-
-
+
+
+ | NUH-Odds Alarm Monitoring
|
-
+
+
+ @switch($alarm_level_id)
+ @case(1)
+ | {{ $message }} |
+ @break
+ @case(2)
+ {{ $message }} |
+ @break
+ @case(3)
+ {{ $message }} |
+ @break
+ @endswitch
+
+
-
-
-
\ No newline at end of file
+
+
+ |
+ {{ $tablecontent[0]['key'] }}
+ |
+
+ {{ $tablecontent[0]['value'] }}
+ |
+
+
+ |
+ {{ $tablecontent[1]['key'] }}
+ |
+
+ {{ $tablecontent[1]['value'] }}
+ |
+
+
+ |
+ {{ $tablecontent[2]['key'] }}
+ |
+
+ {{ $tablecontent[2]['value'] }}
+ |
+
+
+ |
+ {{ $tablecontent[3]['key'] }}
+ |
+
+ {{ $tablecontent[3]['value'] }}
+ |
+
+
+ |
+ {{ $tablecontent[4]['key'] }}
+ |
+
+ {{ $tablecontent[4]['value'] }}
+ |
+
+
+ |
+ {{ $tablecontent[5]['key'] }}
+ |
+
+ {{ $tablecontent[5]['value'] }}
+ |
+
+
+ |
+ {{ $tablecontent[6]['key'] }}
+ |
+
+ {{ $tablecontent[6]['value'] }}
+ |
+
+
+
\ No newline at end of file
|