Compare commits
5 Commits
3a5ac9c130
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 147231f216 | |||
| 80c4f621de | |||
| 4fef8dc165 | |||
| 4283944f33 | |||
| d51688aa2b |
@@ -47,6 +47,13 @@ return [
|
||||
'password' => env('MAIL_PASSWORD'),
|
||||
'timeout' => null,
|
||||
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
|
||||
'stream' => [
|
||||
'ssl' => [
|
||||
'allow_self_signed' => true,
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
@@ -115,4 +122,22 @@ return [
|
||||
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Markdown Mail Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you are using Markdown based email rendering, you may configure your
|
||||
| theme and component paths here, allowing you to customize the design
|
||||
| of the emails. Or, you may simply stick with the Laravel defaults!
|
||||
|
|
||||
*/
|
||||
|
||||
'markdown' => [
|
||||
'theme' => 'default',
|
||||
'paths' => [
|
||||
resource_path('views/vendor/mail'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
@@ -1,33 +1,32 @@
|
||||
@component('mail::message')
|
||||
@if($locale === 'ar')
|
||||
<div dir="rtl" style="text-align: right;">
|
||||
# {{ __('emails.test_email_title', [], $locale) }}
|
||||
|
||||
{{ __('emails.test_email_body', [], $locale) }}
|
||||
|
||||
{{ __('emails.test_email_timestamp', ['time' => now()->format('Y-m-d H:i:s')], $locale) }}
|
||||
|
||||
{{ __('emails.test_email_config_info', [], $locale) }}
|
||||
|
||||
- **{{ __('emails.sender_name', [], $locale) }}** {{ config('mail.from.name') }}
|
||||
- **{{ __('emails.sender_email', [], $locale) }}** {{ config('mail.from.address') }}
|
||||
|
||||
{{ __('emails.regards', [], $locale) }}<br>
|
||||
{{ config('app.name') }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ $locale }}" dir="{{ $locale === 'ar' ? 'rtl' : 'ltr' }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ __('emails.test_email_subject', [], $locale) }}</title>
|
||||
</head>
|
||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; padding: 20px; {{ $locale === 'ar' ? 'text-align: right;' : '' }}">
|
||||
<div style="background: #2D3624; padding: 20px; text-align: center; margin-bottom: 20px;">
|
||||
<h1 style="color: #A68966; margin: 0;">{{ config('app.name') }}</h1>
|
||||
</div>
|
||||
@else
|
||||
# {{ __('emails.test_email_title', [], $locale) }}
|
||||
|
||||
{{ __('emails.test_email_body', [], $locale) }}
|
||||
<div style="background: #F4F1EA; padding: 20px; border-radius: 5px;">
|
||||
<h2 style="color: #2D322A;">{{ __('emails.test_email_title', [], $locale) }}</h2>
|
||||
|
||||
{{ __('emails.test_email_timestamp', ['time' => now()->format('Y-m-d H:i:s')], $locale) }}
|
||||
<p>{{ __('emails.test_email_body', [], $locale) }}</p>
|
||||
|
||||
{{ __('emails.test_email_config_info', [], $locale) }}
|
||||
<p>{{ __('emails.test_email_timestamp', ['time' => now()->format('Y-m-d H:i:s')], $locale) }}</p>
|
||||
|
||||
- **{{ __('emails.sender_name', [], $locale) }}** {{ config('mail.from.name') }}
|
||||
- **{{ __('emails.sender_email', [], $locale) }}** {{ config('mail.from.address') }}
|
||||
<p>{{ __('emails.test_email_config_info', [], $locale) }}</p>
|
||||
|
||||
{{ __('emails.regards', [], $locale) }}<br>
|
||||
{{ config('app.name') }}
|
||||
@endif
|
||||
@endcomponent
|
||||
<ul style="list-style: none; padding: 0;">
|
||||
<li><strong>{{ __('emails.sender_name', [], $locale) }}</strong> {{ config('mail.from.name') }}</li>
|
||||
<li><strong>{{ __('emails.sender_email', [], $locale) }}</strong> {{ config('mail.from.address') }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 20px; padding-top: 20px; border-top: 1px solid #ddd; text-align: center; color: #666; font-size: 12px;">
|
||||
<p>{{ __('emails.regards', [], $locale) }}<br>{{ config('app.name') }}</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -87,7 +87,12 @@ new class extends Component {
|
||||
Mail::to(Auth::user())->send(new TestEmail($locale));
|
||||
Session::flash('test-email-sent', true);
|
||||
} catch (\Exception $e) {
|
||||
\Log::error('Test email failed: ' . $e->getMessage(), [
|
||||
'exception' => get_class($e),
|
||||
'trace' => $e->getTraceAsString(),
|
||||
]);
|
||||
Session::flash('test-email-failed', true);
|
||||
Session::flash('test-email-error', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}; ?>
|
||||
@@ -160,6 +165,11 @@ new class extends Component {
|
||||
<div class="mt-4">
|
||||
<flux:callout variant="danger" icon="exclamation-triangle">
|
||||
{{ __('admin.test_email_failed') }}
|
||||
@if (session('test-email-error'))
|
||||
<div class="mt-2 text-sm opacity-80">
|
||||
{{ session('test-email-error') }}
|
||||
</div>
|
||||
@endif
|
||||
</flux:callout>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user