Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with event registration #38

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

jcsoriano
Copy link
Contributor

Resolves #37

Some notes:

  1. It seems that the EmailMessageServiceProvider extending from Laravel's EventServiceProvider messes up event registration
  2. I checked other packages that listen for the MessageSent event, and they only extend from Illuminate\Support\ServiceProvider
  3. When I tried it, things started working again. The listeners in EventServiceProvider@listen get registered again, and the listener of the package gets registered automatically via autodiscovery again
  4. There is no reason to extend from EventServiceProvider just to use Event::listen, since you could technically use Event::listen from any service provider, so extending from ServiceProvider should be alright and is probably more correct. It seems extending from Illuminate\Events\EventServiceProvider is what broke listener registration on our end

Copy link

what-the-diff bot commented Feb 2, 2024

PR Summary 📝

  • Reworking the EmailMessageServiceProvider Class 📬
    This part of our magical code toolbox, responsible for handling e-mail messages, has seen a few important tweaks:
  1. Elimination of the EventServiceProvider Namespace 🚫
    This part of the code, a sort of digital meeting room where many of the tools our code uses to handle events, was taken out. No need to worry, this doesn't mean our toolbox is short of any tools, it just means we're reorganizing a bit!

  2. Introduction of New Characters to the Story 🎭
    We've welcomed some new players into our magical code realm. This includes:

    • MessageSent class (fresh from the Illuminate\Mail\Events namespace) - it's all about dealing with email messages after they've been sent.
    • Event class from Illuminate\Support\Facades - this one helps our code to marshall events in a better way.
    • ServiceProvider from Illuminate\Support - it's a real generalist! It makes sure that the right tools for the job are in the right place at the right time.
  3. Casting a New Lead Role 🎬
    Instead of the usual EventServiceProvider, we now have ServiceProvider taking the spotlight in the class declaration. It's not a scandal or coup, just a little switcheroo that will make our process more streamlined and efficient! 😉

@RickDBCN
Copy link
Owner

RickDBCN commented Feb 2, 2024

Thanks for quick fix!

@RickDBCN RickDBCN merged commit 42b6946 into RickDBCN:main Feb 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Emails not logging
2 participants