Skip to content

Commit a6a451a

Browse files
update
1 parent 6af4550 commit a6a451a

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

web/Modules/Email/App/Filament/Pages/EmailSettings.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
namespace Modules\Email\App\Filament\Pages;
44

5+
use Filament\Forms\Components\Section;
6+
use Filament\Forms\Components\TextInput;
57
use Filament\Pages\Page;
8+
use Outerweb\FilamentSettings\Filament\Pages\Settings as BaseSettings;
69

7-
class EmailSettings extends Page
10+
class EmailSettings extends BaseSettings
811
{
912
protected static ?string $navigationIcon = 'heroicon-o-cog';
1013

@@ -16,4 +19,24 @@ class EmailSettings extends Page
1619

1720
protected static ?int $navigationSort = 4;
1821

22+
23+
public function schema(): array
24+
{
25+
return [
26+
Section::make('Settings')
27+
->schema([
28+
29+
TextInput::make('email.hostname')
30+
->label('Hostname')
31+
->helperText('The hostname of the SMTP server. Example: mail.yourdomain.com')
32+
->required(),
33+
34+
TextInput::make('email.domain')
35+
->label('Domain')
36+
->helperText('The domain of the SMTP server. Example: yourdomain.com')
37+
->required(),
38+
39+
]),
40+
];
41+
}
1942
}

web/Modules/Email/App/Filament/Pages/SendEmail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function send()
6363
$phpMailer->addAddress($this->to);
6464
$phpMailer->Subject = $this->subject;
6565
$phpMailer->Body = $this->body;
66-
66+
6767
$sendMail = $phpMailer->send();
6868

6969
if ($sendMail) {
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
<x-filament-panels::page>
22

3-
<div>
4-
Email settings
5-
</div>
3+
<form wire:submit="save">
4+
5+
<div class="mb-4">
6+
{{ $this->form }}
7+
</div>
8+
9+
<x-filament::button
10+
type="submit"
11+
wire:loading.attr="disabled"
12+
>
13+
<span wire:loading.remove>Save</span>
14+
<span wire:loading>Saving...</span>
15+
</x-filament::button>
16+
</form>
617

718
</x-filament-panels::page>

0 commit comments

Comments
 (0)