Skip to content

Commit

Permalink
Fix issue with new Laravel 10 Mailer Contract
Browse files Browse the repository at this point in the history
  • Loading branch information
akhan619 committed Apr 29, 2023
1 parent 3e31b7d commit c198f4a
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/App/CustomMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Contracts\Mail\Mailable as MailableContract;
use Illuminate\Mail\Mailer;
use Illuminate\Mail\SentMessage;
use Illuminate\Mail\Mailables\Address;

class CustomMailer extends Mailer
{
Expand All @@ -16,8 +17,12 @@ class CustomMailer extends Mailer
*
* @return Akhan619\LaravelSesEventManager\App\CustomPendingMail
*/
public function to($users)
public function to($users, $name = null)
{
if (!is_null($name) && is_string($users)) {
$users = new Address($users, $name);
}

return (new CustomPendingMail($this))->to($users);
}

Expand All @@ -28,8 +33,12 @@ public function to($users)
*
* @return Akhan619\LaravelSesEventManager\App\CustomPendingMail
*/
public function cc($users)
public function cc($users, $name = null)
{
if (!is_null($name) && is_string($users)) {
$users = new Address($users, $name);
}

return (new CustomPendingMail($this))->cc($users);
}

Expand All @@ -40,8 +49,12 @@ public function cc($users)
*
* @return Akhan619\LaravelSesEventManager\App\CustomPendingMail
*/
public function bcc($users)
public function bcc($users, $name = null)
{
if (!is_null($name) && is_string($users)) {
$users = new Address($users, $name);
}

return (new CustomPendingMail($this))->bcc($users);
}

Expand Down

0 comments on commit c198f4a

Please sign in to comment.