Closed nacho-villanueva closed 1 year ago
In the PostmarkServiceProvider.php I found that the message_stream_id is always being fetched from the mailer named 'postmark', as you can see below.
public function boot(): void
{
$this->loadViewsFrom(__DIR__.'/../resources/views', 'postmark');
$this->app['mail.manager']->extend('postmark', function () {
$config = $this->app->make('config');
return new PostmarkTransport(
$this->app->make(Factory::class),
$config->get('mail.mailers.postmark.message_stream_id'),
$config->get('services.postmark.token'),
);
});
}
As a work around, I solved it be creating a new Transport in my AppServiceProvider, but probably it should be changed in the repo. Here is my change:
Mail::extend('postmark-broadcast', function ($config) {
$globalService = $this->app->make('config');
return new PostmarkTransport(
$this->app->make(Factory::class),
$config['message_stream_id'],
$globalService->get('services.postmark.token'),
);
});
Cheers!
Hey @nacho-villanueva! Great catch, thank you! This is resolved in v3.0.4 with 50147a4cb8
I'm trying to configure 2 mailers, one for postmark transactionals and another for broadcasts. in the following way, but when I try to send a notification using the "postmark-broadcast" it doesn't take use the message_stream_id of that mailer, instead uses the one from "postmark" mailer. Is this a bug, or am I doing something wrong?