Skip to content

Commit

Permalink
Merge branch 'main' into feature/tenant-support
Browse files Browse the repository at this point in the history
  • Loading branch information
marcogermani87 authored May 3, 2024
2 parents 90dd75f + 063562e commit 261f733
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ php artisan vendor:publish --tag="filament-email-config"

Register the plugin through your panel service provider:
```php
->plugin(new \RickDBCN\FilamentEmail\FilamentEmail::make())
->plugin(\RickDBCN\FilamentEmail\FilamentEmail::make())
```

## Configuration
Expand Down
8 changes: 5 additions & 3 deletions resources/views/raw_body.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
@php
$content = $getRecord()->raw_body;
$path = storage_path('app' . DIRECTORY_SEPARATOR . $content);
if (file_exists($path)) {
$content = file_get_contents($path);
if (!empty($content)) {
$path = storage_path('app' . DIRECTORY_SEPARATOR . $content);
if (file_exists($path)) {
$content = file_get_contents($path);
}
}
@endphp

Expand Down
9 changes: 5 additions & 4 deletions src/Models/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,22 @@ public static function boot()
array_pop($parts);
$folderPath = implode(DIRECTORY_SEPARATOR, $parts);
}
if (file_exists($filePath)) {
if (! is_dir($filePath) && file_exists($filePath)) {
unlink($filePath);
}
}
}
$savePathRaw = storage_path('app' . DIRECTORY_SEPARATOR . $record->raw_body);
if (file_exists($savePathRaw)) {

$savePathRaw = storage_path('app'.DIRECTORY_SEPARATOR.$record->raw_body);
if (! is_dir($savePathRaw) && file_exists($savePathRaw)) {
if (empty($folderPath)) {
$parts = explode(DIRECTORY_SEPARATOR, $savePathRaw);
array_pop($parts);
$folderPath = implode(DIRECTORY_SEPARATOR, $parts);
}
unlink($savePathRaw);
}
if (file_exists($folderPath)) {
if (is_dir($folderPath) && file_exists($folderPath)) {
rmdir($folderPath);
}
});
Expand Down

0 comments on commit 261f733

Please sign in to comment.