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

NotificationMailer constructor parameters changed in Flarum 1.5, override broken #29

Closed
clarkwinkelmann opened this issue Sep 15, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@clarkwinkelmann
Copy link
Member

SettingsRepositoryInterface $settings was added as a third constructor parameter to NotificationMailer in Flarum 1.5.

https://github.com/flarum/framework/blob/v1.5.0/framework/core/src/Notification/NotificationMailer.php#L40

public function __construct(Mailer $mailer, TranslatorInterface $translator, SettingsRepositoryInterface $settings)

It throws an error because we are not providing the correct number of parameters in our extended class:

public function __construct(Mailer $mailer, View $view, SettingsRepositoryInterface $settings, TranslatorInterface $translator, UrlGenerator $url, Paths $paths)
{
parent::__construct($mailer, $translator);
$this->view = $view;
$this->settings = $settings;
$this->url = $url;
$this->assets_dir = $paths->public.DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR;
}

Change made in flarum/framework#3525

@clarkwinkelmann clarkwinkelmann added the bug Something isn't working label Sep 15, 2022
@betalk-ir
Copy link

Hi, Any progress to fix?
I just waiting for this extension to upgrade to 1.5!
My forum just send alot mails to users and don't want to send email without our custom template.

@clarkwinkelmann
Copy link
Member Author

Fixed in version 1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants