Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Sep 27, 2024
1 parent 97483c8 commit 6241f2c
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web/Modules/Email/App/Filament/Resources/EmailDomainResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Modules\Email\App\Http\Livewire\DkimSetup;
use Modules\Email\App\Models\EmailBox;
use Modules\Email\DkimDomainSetup;

Expand Down Expand Up @@ -47,11 +48,14 @@ public static function table(Table $table): Table
//
])
->actions([
Tables\Actions\Action::make('dkimSetup')
Tables\Actions\ViewAction::make('dkimSetup')
->label('DKIM Setup')
->action(function (Domain $record) {
$output = DkimDomainSetup::run($record->domain);
dd($output);
->form(function (Domain $record) {
return [
Forms\Components\Livewire::make(DkimSetup::class, [
'domain' => $record->domain,
]),
];
})
->icon('heroicon-o-pencil'),
])
Expand Down
27 changes: 27 additions & 0 deletions web/Modules/Email/App/Http/Livewire/DkimSetup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Modules\Email\App\Http\Livewire;

use Livewire\Component;
use Modules\Email\DkimDomainSetup;

class DkimSetup extends Component
{
public $domain;

public function render()
{
$secure = $this->secure();

return view('email::livewire.dkim-setup', [
'secure' => $secure,
]);
}

public function secure()
{
$output = DkimDomainSetup::run($this->domain);

return $output;
}
}
19 changes: 19 additions & 0 deletions web/Modules/Email/resources/views/livewire/dkim-setup.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div>
@if(isset($secure['text']))

<div class="w-full p-2">
Please add the following DNS record to your domain's DNS settings:
</div>

<div class="w-full mt-2">
<textarea rows="10" class="w-full p-4 rounded-md border-2 border-gray-100">
{{ $secure['text'] }}
</textarea>
</div>

<x-filament::button wire:click="verify">
Check DNS Record
</x-filament::button>

@endif
</div>

0 comments on commit 6241f2c

Please sign in to comment.