add tests batch 20
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Services\Frontend;
|
||||
|
||||
use App\Models\Configuration;
|
||||
use App\Models\ContactUs;
|
||||
use App\Models\Configuration;
|
||||
use App\Services\Email\EmailDispatchService;
|
||||
use App\Services\System\GlobalConfigService;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -13,7 +13,8 @@ class ContactSubmissionService
|
||||
public function __construct(
|
||||
private EmailDispatchService $emailService,
|
||||
private GlobalConfigService $configService
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function submit(array $payload): array
|
||||
{
|
||||
@@ -35,20 +36,20 @@ class ContactSubmissionService
|
||||
'school_year' => $schoolYear ?: '2025-2026',
|
||||
]);
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('Contact submission save failed: '.$e->getMessage());
|
||||
Log::error('Contact submission save failed: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$recipient = Configuration::getConfig('administrator_email')
|
||||
?: (string) config('mail.from.address', '')
|
||||
?: 'alrahma.isgl@gmail.com';
|
||||
|
||||
$htmlMessage = nl2br('You have received a new message from '.$email.":\n\n".$message);
|
||||
$htmlMessage = nl2br('You have received a new message from ' . $email . ":\n\n" . $message);
|
||||
|
||||
$emailSent = false;
|
||||
if (! app()->runningUnitTests()) {
|
||||
if (!app()->runningUnitTests()) {
|
||||
$emailSent = $this->emailService->send($recipient, $subject, $htmlMessage, null, $email, $email);
|
||||
if (! $emailSent) {
|
||||
Log::error('Contact submission email failed for '.$email);
|
||||
if (!$emailSent) {
|
||||
Log::error('Contact submission email failed for ' . $email);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user