From 6955611c979f993a35a7f760d000664a498ff406 Mon Sep 17 00:00:00 2001 From: Ahmed Alaa <92916738+AhmedAlaa4611@users.noreply.github.com> Date: Sat, 12 Jul 2025 21:19:23 +0300 Subject: [PATCH 1/2] Complete Mailchimp transport example --- mail.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mail.md b/mail.md index a703545682..d9b743f3a3 100644 --- a/mail.md +++ b/mail.md @@ -1511,6 +1511,7 @@ Once you've defined your custom transport, you may register it via the `extend` ```php use App\Mail\MailchimpTransport; use Illuminate\Support\Facades\Mail; +use MailchimpTransactional\ApiClient; /** * Bootstrap any application services. @@ -1518,7 +1519,11 @@ use Illuminate\Support\Facades\Mail; public function boot(): void { Mail::extend('mailchimp', function (array $config = []) { - return new MailchimpTransport(/* ... */); + $client = new ApiClient; + + $client->setApiKey($config['mailchimp_api_key']); + + return new MailchimpTransport($client); }); } ``` @@ -1528,6 +1533,7 @@ Once your custom transport has been defined and registered, you may create a mai ```php 'mailchimp' => [ 'transport' => 'mailchimp', + 'mailchimp_api_key' => env('MAILCHIMP_API_KEY'), // ... ], ``` From 340dc165a2f0a3c49d219878ab8cf36769c50478 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 12 Jul 2025 16:29:57 -0400 Subject: [PATCH 2/2] Update mail.md --- mail.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mail.md b/mail.md index d9b743f3a3..cfe6c39f60 100644 --- a/mail.md +++ b/mail.md @@ -1521,7 +1521,7 @@ public function boot(): void Mail::extend('mailchimp', function (array $config = []) { $client = new ApiClient; - $client->setApiKey($config['mailchimp_api_key']); + $client->setApiKey($config['key']); return new MailchimpTransport($client); }); @@ -1533,7 +1533,7 @@ Once your custom transport has been defined and registered, you may create a mai ```php 'mailchimp' => [ 'transport' => 'mailchimp', - 'mailchimp_api_key' => env('MAILCHIMP_API_KEY'), + 'key' => env('MAILCHIMP_API_KEY'), // ... ], ```