-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Use different POSTMARK_SECRET & POSTMARK_SERVER? #149
Comments
Hey @christoph-werker, is this something that was made possible by #134? |
Hi @craigpaul , That was fast. 💪 Furthermore what could be an elegant way to implement this? Without redundant code? |
@christoph-werker The We started off with creating a custom $secret = '...'; // your updated secret
config()->set('mail.driver', 'postmark-custom');
config()->set('mail.default', 'postmark-custom');
config()->set('postmark.secret', $secret); // `services.postmark.secret` also works in this version of the package
app('mail.manager')->extend('postmark-custom', function () use ($secret) {
return new PostmarkTransport(
app(Factory::class),
config()->get('mail.mailers.postmark.message_stream_id'),
[],
$secret,
);
});
$this->mailer = app()->make('mail.manager'); The problem with doing this in a long running process like a queue worker/Horizon is that those configuration changes stick around for the next email being sent through that process, so you also need a way to reset |
Detailed description
I have software that manages client orders, and depending on the order, I need to use a specific
POSTMARK_SECRET
andPOSTMARK_SERVER
. Maybe I overlooked something, but how can I accomplish that?Your environment
Include as many relevant details about the environment you experienced the bug in and how to reproduce it.
The text was updated successfully, but these errors were encountered: