fix gitlab tests
This commit is contained in:
@@ -2,14 +2,16 @@
|
||||
|
||||
namespace App\Services\Grading;
|
||||
|
||||
use App\Services\EmailService;
|
||||
use App\Support\MailHtml;
|
||||
use App\Services\EmailService;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class BelowSixtyEmailService
|
||||
{
|
||||
public function __construct(private EmailService $emailService) {}
|
||||
public function __construct(private EmailService $emailService)
|
||||
{
|
||||
}
|
||||
|
||||
public function send(array $payload): array
|
||||
{
|
||||
@@ -23,7 +25,6 @@ class BelowSixtyEmailService
|
||||
|
||||
if ($studentId <= 0) {
|
||||
Log::warning('Below60Email: missing student_id');
|
||||
|
||||
return ['ok' => false, 'message' => 'Missing student id.'];
|
||||
}
|
||||
|
||||
@@ -41,7 +42,6 @@ class BelowSixtyEmailService
|
||||
|
||||
if (empty($rows)) {
|
||||
Log::warning('Below60Email: no guardian emails', ['student_id' => $studentId]);
|
||||
|
||||
return ['ok' => false, 'message' => 'No guardian email addresses.'];
|
||||
}
|
||||
|
||||
@@ -57,17 +57,17 @@ class BelowSixtyEmailService
|
||||
$primary = $rows[0] ?? null;
|
||||
$parentName = '';
|
||||
if ($primary) {
|
||||
$parentName = trim((string) ($primary->firstname ?? '').' '.(string) ($primary->lastname ?? ''));
|
||||
$parentName = trim((string) ($primary->firstname ?? '') . ' ' . (string) ($primary->lastname ?? ''));
|
||||
}
|
||||
|
||||
$subject = (string) ($payload['subject'] ?? '');
|
||||
if ($subject === '') {
|
||||
$subject = 'Student Performance Alert';
|
||||
if ($studentName !== '') {
|
||||
$subject .= ' — '.$studentName;
|
||||
$subject .= ' — ' . $studentName;
|
||||
}
|
||||
if ($semester !== '' || $schoolYear !== '') {
|
||||
$subject .= ' ('.trim($semester.' '.$schoolYear).')';
|
||||
$subject .= ' (' . trim($semester . ' ' . $schoolYear) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user