add tests batch 20

This commit is contained in:
root
2026-06-09 01:03:53 -04:00
parent 95efb9652e
commit 6be4875c5e
1502 changed files with 13797 additions and 11313 deletions
+6 -5
View File
@@ -7,23 +7,24 @@ 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');
}