fix tests

This commit is contained in:
root
2026-06-11 11:46:12 -04:00
parent c91fa2ce4d
commit 5ead80fdc7
1489 changed files with 11349 additions and 10305 deletions
+5 -6
View File
@@ -7,24 +7,23 @@ use Illuminate\Support\Facades\Log;
class UserEventService
{
public function __construct(private EmailService $emailService)
{
}
public function __construct(private EmailService $emailService) {}
public function handleNewAccountAdded(array $userData): bool
{
$email = (string) ($userData['email'] ?? '');
if ($email === '') {
Log::warning('UserEventService: missing email for welcome message.');
return false;
}
$name = trim((string) (($userData['firstname'] ?? '') . ' ' . ($userData['lastname'] ?? '')));
$name = trim((string) (($userData['firstname'] ?? '').' '.($userData['lastname'] ?? '')));
$safeName = e($name !== '' ? $name : 'there');
$subject = 'Welcome to Al Rahma Sunday School!';
$message = '<p>Hello ' . $safeName . ',</p>'
. '<p>Your account has been created. Welcome to Al Rahma Sunday School.</p>';
$message = '<p>Hello '.$safeName.',</p>'
.'<p>Your account has been created. Welcome to Al Rahma Sunday School.</p>';
return $this->emailService->send($email, $subject, $message, 'registration');
}