Fix Pint formatting

This commit is contained in:
root
2026-06-09 01:25:14 -04:00
parent 6be4875c5e
commit 20a0b6c4e5
1485 changed files with 11318 additions and 10273 deletions
@@ -10,8 +10,7 @@ class DefaultAttendanceMailerService implements AttendanceMailerService
public function __construct(
protected EmailService $emailService,
protected AttendanceEmailComposerService $emailComposerService
) {
}
) {}
public function send(string $to, string $subject, string $html): bool
{
@@ -26,24 +25,24 @@ class DefaultAttendanceMailerService implements AttendanceMailerService
}
$student = (array) ($payload['student'] ?? []);
$studentName = trim((string) ($student['firstname'] ?? '') . ' ' . (string) ($student['lastname'] ?? ''));
$studentName = trim((string) ($student['firstname'] ?? '').' '.(string) ($student['lastname'] ?? ''));
$subjectType = (string) ($payload['subject'] ?? 'Attendance');
$date = substr((string) ($payload['date'] ?? now()->toDateString()), 0, 10);
$subject = "Attendance Notice: {$subjectType}";
$body = '<p>Dear ' . e((string) data_get($payload, 'parent.name', 'Parent/Guardian')) . ',</p>'
. '<p>This is an attendance notification for your student.</p>'
. '<ul>'
. '<li><strong>Student:</strong> ' . e($studentName !== '' ? $studentName : 'Student') . '</li>'
. '<li><strong>Date:</strong> ' . e($date) . '</li>'
. '<li><strong>Attendance:</strong> ' . e($subjectType) . '</li>'
. '</ul>'
. '<p>If you have any questions, please contact the school office.</p>';
$body = '<p>Dear '.e((string) data_get($payload, 'parent.name', 'Parent/Guardian')).',</p>'
.'<p>This is an attendance notification for your student.</p>'
.'<ul>'
.'<li><strong>Student:</strong> '.e($studentName !== '' ? $studentName : 'Student').'</li>'
.'<li><strong>Date:</strong> '.e($date).'</li>'
.'<li><strong>Attendance:</strong> '.e($subjectType).'</li>'
.'</ul>'
.'<p>If you have any questions, please contact the school office.</p>';
$html = $this->emailComposerService->renderWithEmailLayout($subject, $body);
if (!$this->send($to, $subject, $html)) {
Log::error('Attendance notification email failed for ' . $to);
if (! $this->send($to, $subject, $html)) {
Log::error('Attendance notification email failed for '.$to);
throw new \RuntimeException('Failed to send attendance notification email.');
}
}