simonschaufi / laravel-dkim

Laravel package for signing outgoing messages with DKIM
https://www.simonschaufelberger.de/de/projekte/laravel-packages/laravel-dkim.html
MIT License
23 stars 9 forks source link

Return value must be of type ?Illuminate\Mail\SentMessage, int returned #26

Closed matze1708 closed 1 month ago

matze1708 commented 1 month ago

Hello! I have a problem with your DKIM implementation. I get the following error when I send a mail:

php artisan Mail:sendShootingbookRequest

   TypeError 

  SimonSchaufi\LaravelDKIM\Mailer::send(): Return value must be of type ?Illuminate\Mail\SentMessage, int returned

  at vendor\simonschaufi\laravel-dkim\src\Mailer.php:25
     21▕      */
     22▕     public function send($view, array $data = [], $callback = null): ?SentMessage
     23▕     {
     24▕         if ($view instanceof MailableContract) {
  ➜  25▕             return $this->sendMailable($view);
     26▕         }
     27▕
     28▕         // First we need to parse the view, which could either be a string or an array
     29▕         // containing both an HTML and plain text versions of the view which should

  1   vendor\laravel\framework\src\Illuminate\Mail\PendingMail.php:124
      SimonSchaufi\LaravelDKIM\Mailer::send(Object(App\Mail\sendopenshootingbookrequestMail))

  2   app\Http\Controllers\api\v1\SendMailsController.php:116
      Illuminate\Mail\PendingMail::send(Object(App\Mail\sendopenshootingbookrequestMail))

What does the system want from me? Where should I look for the error

Thank you

simonschaufi commented 1 month ago

It seams like you are not using the latest version. can you please update and see if the error is still there? See #25 for a fix.