Bogardo / Mailgun

Mailgun package for Laravel
MIT License
295 stars 116 forks source link

Type error: Argument 1 passed must be an instance of App\Http\Controllers\Message #142

Closed periplox closed 6 years ago

periplox commented 6 years ago

Hey guys, I got an error when trying to send a mail witha fairly basic example:

Mailgun::send('email.main', $art_data, function(Message $message){
    $message->to("xxxx@xxxx.com");
});

The error message:

Type error: Argument 1 passed to App\Http\Controllers\ArticleController::App\Http\Controllers\{closure}() must be an instance of App\Http\Controllers\Message, instance of Bogardo\Mailgun\Mail\Message given

I've checked every installation step, config, etc. But I'm pretty much stuck here. What am I missing?

Some extra info:

Thanks!

periplox commented 6 years ago

Ok, i finally figure it out. I was instantiating the wrong Message class.

Thanks!