Closed jaltfeld closed 6 years ago
I'm getting the same, I guess Mailgun response structure has been changed in the meantime. Is this an abandoned project? I can't get it to work at all.
@jaltfeld I've got the answer here: https://github.com/Bogardo/Mailgun/issues/144#issuecomment-403428850
@csimpi Hey thanks a lot for looping me in on that answer - I ended up moving on from the bogardo mailgun package for a more hand made workaround a while back but if I end up working with it again (which I may, now that you've given me this piece of information), then I'll know the genuine solution - thanks!
Hi @Bogardo and/or anyone who can help,
I installed
Bogardo/Mailgun
(with"php-http/guzzle6-adapter": "^1.1"
) to my Laravel 5.3 project according to the github instructions at the time of this message, BUT only after installingmailgun/mailgun-php
(with"guzzlehttp/psr7": "^1.4"
and"guzzlehttp/guzzle": "^6.3"
)...Initially I was using the
$mg->messages()->send($domain, $params);
functionality of the mailgun/mailgun-php package, which was working fine and sending basic text emails, but eventually I wanted to send an actual email view via Laravel's "send()" method as Bodargo/Mailgun utilizes. So I went ahead and installed it as outlined by the read-me.I had a hard time importing the package with the "use" statement at first but eventually realized that the service provider alias allowed me to simply say "use Mailgun" - then my errors began to change and eventually I ended up getting the following error...
"Trying to get property of non-object" on line 37 of ".../vendor/bogardo/mailgun/src/Http/Response.php"
..this line is setting
$this->message = $response->http_response_body->message;
only my problem is that I was getting back "Mailgun Magnificent API" as my http_response_body where the package is expecting an object with a "message" property - I realize this may be due to my own configuration settings either locally or in my mailgun account - however my emails were sending with the mailgun/mailgun-php package so I'm guessing my mailgun account settings must be okay...However when you bind the guzzle adapter to the application in the AppServiceProvider.php - the instructions seem to suggest that you apply your guzzle settings here - I left this section empty because I never had to specify with the mailgun/mailgun-php package (which isn't Bogardo/Mailgun built on?) - and everything sent just fine.
Is this the reason for my getting the wrong response?
Also when I modify that line to
$this->message = $response->http_response_body;
I get back no error but nothing happens and the mailgun dash reflects no activity whatsoever - so there's another clue.I'm also wondering is it possible that I could have something missing from my .env settings (I also did NOT set any settings in the generated "config/mailgun.php" file - I figured the .env was enough) - my mail related settings there are as follows...
...also if it helps I have the following packages installed on this project...
Any suggestions on the matter would be greatly appreciated - I'd really like to use this package to send html emails via Laravel blade views - rather then regular text emails with the other mailgun/mailgun-php package
...but right now that's all that I can get to work - anybody got any pointers??
Thanks ahead of time! -jaltfeld