Closed mvdnbrk closed 2 years ago
I needed this feature for a project, and was able to get it working. For clarity, this does remove some of the fall-back values in the base code. (see PostmarkServiceProvider.php line 29)
use Coconuts\Mail\PostmarkTransport;
use GuzzleHttp\Client as HttpClient;
// This updates the postmark server just before sending.
app('mail.manager')->extend('postmark', function () {
return new PostmarkTransport(
new HttpClient(config('postmark.guzzle')),
'CUSTOM-POSTMARK-SERVER-KEY'
);
});
Mail::to(auth()->user())->send(new \App\Mail\Test($mergedata));
I'm going to remove this from the 3.x
milestone as we don't necessarily need this to be ready to go before Laravel 9.0 is released.
Postmark uses the concept of servers. Each server has its own api token.
At the moment there is only one way to set this api token, with
POSTMARK_SECRET
env variable.If an app requires sending messages to different servers this can not be done easily.
We should add the ability to set the api token on the fly.