GithubHelp home page GithubHelp logo

rickdbcn / filament-email Goto Github PK

View Code? Open in Web Editor NEW
65.0 2.0 17.0 1.83 MB

Log emails in your Filament project

Home Page: https://filament-email-demo.marcogermani.it/

License: MIT License

PHP 94.98% Blade 5.02%
email email-log filament laravel php

filament-email's People

Contributors

atmonshi avatar dependabot[bot] avatar edwink75 avatar github-actions[bot] avatar jacobtims avatar jcsoriano avatar jeromesiau avatar marcogermani87 avatar mstfkhazaal avatar nilede-bharat avatar quasiperfect avatar rickdbcn avatar sitenzo avatar torriv83 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

filament-email's Issues

Manual delete

Would be nice to be able to delete emails manually.

Add the ability to set the FilamentEmailLogger class in the config

Is your feature request related to a problem? Please describe.
I would like to add extra fields when logging to the database, such as the currently logged on user, etc.

Describe the solution you'd like
If I could set the FilamentEmailLogger class in the config, (the same as you've done with EmailResource), then I could add the fields required.

Describe alternatives you've considered
Alternatively you could modify your Email class to look for specific session variables, either fixed or dynamic. Eg. you could:

public function handle(object $event): void
$model::create([
...
'foreign_id' => session("filament_email_foreign_id")

You could also have an array of fields to populate in the config file?

Additional context
Thank you, for your time!

[Bug]: Background Issue

What happened?

It does not look good with a transparent background. Ability to add bg-white as background.

I think using Infolist TextEntry here will be more beneficial here.

Screenshot 2023-08-23 at 9 12 07 PM

How to reproduce the bug

You can check on your Admin Panel

Package Version

latest

PHP Version

v8.1.19

Laravel Version

v10.14.0

Which operating systems does with happen with?

No response

Notes

No response

Update project description and tags

Hi @RickDBCN, you can update this section?

image

I think can be usefull to add this description, "Log emails in your Filament project" and this tags: "php, laravel, filament, log, email"

Thanks.

[Bug]: Column not found: 1054 Unknown column 'team_id' in 'where clause'

What happened?

Going to the view page, I expect to see a list of emails.

How to reproduce the bug

Config is the stock config, I added this to my Filament panel which doesn't have tenancy. I have other panels that do have tenancy, but the email logging is not in place for those.

Package Version

1.3

PHP Version

8.3

Laravel Version

10.48.10

Which operating systems does with happen with?

Linux

Notes

Getting this error when attempting to view the emails: Column not found: 1054 Unknown column 'team_id' in 'where clause'.

This is the query that's failing: SELECT count(*) AS aggregate FROM filament_email_logWHEREteam_id IS NULL.

There is not a team_id field on the filament_email_log table.

This was previously working, until today.

https://flareapp.io/share/dmkDvqDP

[Bug]: Packagist not sync with latest release

What happened?

Packagist not sync with latest release

How to reproduce the bug

Update package

Package Version

1.2.1

PHP Version

8.2

Laravel Version

10

Which operating systems does with happen with?

Linux

Notes

No response

[Bug]: Emails not logging

What happened?

When mail notifications are sent, it's not being logged

While debugging, I do php artisan event:list --event=MessageSent and the package's listener doesn't show

How to reproduce the bug

Simply follow the package's Installation instructions

Package Version

1.0.11

PHP Version

8.2.8

Laravel Version

10.43.0

Which operating systems does with happen with?

macOS

Notes

No response

Add model and model_id ?

Ideally adding the model sending the email and the model_id would then mean we can have email transactions for the model.

I built something similar whereby we store the id and model so we can then find the transactions and render them in an action on the model record so users can easily see the status of send emails, but I took it one step further and built malign integration and a web hook so we can show status, deliveries and opens/clicks.

[Bug]: Class name must be a valid object or a string

What happened?

After composer update today, I get the following error:

Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   Error

  Class name must be a valid object or a string

  at vendor\rickdbcn\filament-email\src\FilamentEmailServiceProvider.php:35
     31▕
     32▕     public function bootingPackage()
     33▕     {
     34▕         $this->callAfterResolving(Schedule::class, function (Schedule $schedule) {
  ➜  35▕             $class = get_class(new (Config::get('filament-email.resource.model')));
     36▕             if (class_exists($class)) {
     37▕                 $schedule->command('model:prune --model="'.$class.'"')->daily();
     38▕             }
     39▕         });

  1   vendor\laravel\framework\src\Illuminate\Container\Container.php:1294
      RickDBCN\FilamentEmail\FilamentEmailServiceProvider::RickDBCN\FilamentEmail\{closure}(Object(Illuminate\Console\Scheduling\Schedule), Object(Illuminate\Foundation\Application))

  2   vendor\laravel\framework\src\Illuminate\Container\Container.php:1258
      Illuminate\Container\Container::fireCallbackArray(Object(Illuminate\Console\Scheduling\Schedule))

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

How to reproduce the bug

composer update

Package Version

1.2.0

PHP Version

8.2

Laravel Version

11.4.0

Which operating systems does with happen with?

Windows

Notes

No response

[Bug]: The Update and resend e-mail Action doesn't work if an email has no attachment

What happened?

Here is the error: local.ERROR: Undefined array key "attachments"

How to reproduce the bug

Just try to click the Update and Resend email button on an email without attachments and see the internal error yourself.

Package Version

1.4

PHP Version

8.3

Laravel Version

10

Which operating systems does with happen with?

Windows

Notes

No response

add possibility to show the menu item conditionally

Is your feature request related to a problem? Please describe.
I need to hide menu item for some users role

Describe the solution you'd like
very basic solution I've found is to add canView method in EmailResource
es:
public static function canViewAny(): bool
{
return auth()->user()->{Config::get('filament-email.resource.canViewMethod')}();
}
And in config add the name of the method
'resource' => [
...
'canViewMethod' => 'isAdmin'
],
in User model
public function isAdmin(): bool
{
return $this->hasRole('Administrator');
}
Thanks
Cosimo

[Bug]: ParseError after composer update: Unexpected identifier in EmailResource

What happened?

After running composer update, I encountered a ParseError with the message:

syntax error, unexpected identifier "filament", expecting ")"

The error traces back to vendor/rickdbcn/filament-email/src/Filament/Resources/EmailResource.php on line 34:
return __('Config::get('filament-email.label')') ?? __('Email log');

The issue seems to be with the incorrect usage of single quotes inside the translation function. Instead of evaluating the Config::get() method, it's treated as a literal string causing the syntax error.

How to reproduce the bug

  1. Install the rickdbcn/filament-email package.
  2. Run composer update.
  3. Navigate to any route or command that would use the EmailResource class from the filament-email package.
  4. The error should appear and reference the mentioned line of code.

Package Version

1.0.8

PHP Version

8.2.10

Laravel Version

10.30.1

Which operating systems does with happen with?

Linux

Notes

A possible fix for the getNavigationLabel method is:
return __(Config::get('filament-email.label', 'Email log'));

The getNavigationGroup method has an incorrect usage of the nullish coalescing operator. The correct implementation should be:
return __(Config::get('filament-email.resource.group', parent::getNavigationGroup()));

It would be beneficial to add unit tests to catch these kinds of issues in the future.

Thank you for looking into this!

Add support for Shield

Is your feature request related to a problem? Please describe.
I always look to control access to resources/pages, Shield is what I'm currently using within Filament.

Describe the solution you'd like
The ability to enable support for Shield. For now the plugin doesn't support methods such as usingPage() which make it easy to create an override of the default Page class where we can add the HasPageShield Trait.

Are there better/easier approaches?

Publishing assets throws error

What happened?

Executing the php artisan command to publish the assets throws this error:

$ php artisan vendor:publish --tag="filament-email-migrations"

   INFO  Publishing [filament-email-migrations] assets.

   ERROR  Can't locate path: <vendor/rickdbcn/filament-email/src/../database/migrations/create_femail_table.php.stub>.

How to reproduce the bug

Run the php artisan command shown above.

Package Version

v1.0.1

PHP Version

8.2.3

Laravel Version

10.17.1

Which operating systems does with happen with?

No response

Notes

There appears to be a typo here:

->hasMigration('create_femail_table');

[Bug]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'team_id' in 'where clause'

What happened?

After running composer update I am getting this error when accessing the main resource page for the email logs:

Screenshot 2024-05-09 122618

This is the relevant output from the composer update command:

Upgrading rickdbcn/filament-email (v1.3.1 => v1.4.0): Extracting archive

How to reproduce the bug

Simply upgrade from version 1.3.1 to 1.4.0.

The config file wasn't changed, here are the contents:

<?php

// config for RickDBCN/FilamentEmail
return [

    'resource' => [
        'group' => 'Logs',
        'sort' => null,
        'default_sort_column' => 'created_at',
        'default_sort_direction' => 'desc',
    ],

    'keep_email_for_days' => 60,
    'label' => null,
];

There are no pending migrations after the update.

Package Version

1.4.0

PHP Version

8.2.15

Laravel Version

10.48.10

Which operating systems does with happen with?

Linux

Notes

The app where this happened doesn't have a team model.

[Bug]: Responsive Layout Issue

What happened?

It doesn't support a responsive layout yet.

Screenshot 2023-08-23 at 9 13 55 PM

How to reproduce the bug

check on mobile responsive layout

Package Version

latest

PHP Version

v8.1.19

Laravel Version

v10.14.0

Which operating systems does with happen with?

No response

Notes

No response

Option to override the default Mail model class

I want to override the default Mail model class because I use tenancy in my application. I would like to have a similar option in the config, as the override for the Filament EmailResource class.
Something like this:

<?php

// config for RickDBCN/FilamentEmail
return [
    'resource' => [
        'class' => \App\Filament\Resources\EmailResource::class,
        'model' => \App\Models\Email::class,
    ],
];

I now need to force override it in my AppServiceProvider register() method, which is not a nice way:

$loader = AliasLoader::getInstance();
$loader->alias(\RickDBCN\FilamentEmail\Models\Email::class, \App\Models\Email::class);

Use policy

What happened?

I don't use Shield but I use very simple laravel policies

It seems my policy is ignored and I'm not sure how to fit it

How to reproduce the bug

  1. install plugin
  2. create a policy with the same name php artisan make:policy EmailPolicy
  3. Set return false in viewAny, the page should not be visible in the navigation anymore

It's the first time I'm trying to use a policy on a resource coming from a plugin so I might do something wrong

Package Version

1.0.10

PHP Version

8.2.14

Laravel Version

10.10

Which operating systems does with happen with?

macOS

Notes

No response

Show attachments

Describe the solution you'd like
It would be great to see documents that were attached to the sent email, or at least a link to them.

[Bug]:

What happened?

As stated in the discord chat a while back, the Bulk action does not delete.

How to reproduce the bug

I check all the emails i want to delete, choose bulk action, and then delete. i get a message saying that the records are successfully deleted. but they are not.

Package Version

1.0.7

PHP Version

8.2.0

Laravel Version

10.28.0

Which operating systems does with happen with?

No response

Notes

No response

[Bug]: Translation on "Preview" label

What happened?

I cannot change the translation label on the resource page

php Action::make('preview')->label('Preview')

Should be like :

php Action::make('resend')->label(__('Send again'))

How to reproduce the bug

Add on my locale file the "Preview" key and nothing change

Package Version

1.0.5

PHP Version

8.2

Laravel Version

10

Which operating systems does with happen with?

macOS, Linux

Notes

The PR is already done from my side on fork

[Bug]: make navigation group label translatable via __()

What happened?

cannot use other language menu.

How to reproduce the bug

just install latest version with multiple localisation

Package Version

v1.0.11

PHP Version

8.2.12

Laravel Version

10.39.0

Which operating systems does with happen with?

macOS

Notes

public static function getNavigationGroup(): ?string
    {
        return __(Config::get('filament-email.resource.group' ?? parent::getNavigationGroup()));
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.