<?php

namespace App\Services;
use App\Models\UserModel;


class UserEventService
{
    public function handleNewAccountAdded(array $userData): void
    {
        log_message('info', 'New account created: ' . json_encode($userData));

        $emailService = new \App\Services\EmailService();
        $subject = '🎉 Welcome to Al Rahma Sunday School!';
        $message = view('emails/welcome_user', ['user' => $userData]);

        $emailService->send(
            $userData['email'],
            $subject,
            $message,
            'registration'
        );
    }
}