Comments (15)
Thanks @CupOfTea696 in the end my message was Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email. How frustrating!
from mailgun.
Hi @ivkean,
Do you have a mail.blade.php template in your views directory?
from mailgun.
yes, and it's code:
{{ $customer }}
from mailgun.
All required fields in the configuration file are entered?
https://github.com/Bogardo/Mailgun#configuration
from mailgun.
@ivkean Have you managed to solve the issue?
from mailgun.
@Bogardo
Not yet, i set up mailgun account free. Is that why i can not send mail ?
from mailgun.
I have the same issue. I checked my config file a million times. I always get those kinds of errors.
I get the error The parameters passed to the API were invalid. Check your inputs!
on Mailgun::lists()->create()
I'm using the exact code from the documentation.
When I call Mailgun::lists()->all();
everything works perfectly.
from mailgun.
I found the error. The problem is that the Mailgun-PHP package just throws that exception and disregards the data it gets. I edited the file where the error was and just did a var_dump()
of the response it actually gets. Here's what came out:
{
"message": "The 'address' parameter should be a valid email address"
}
Maybe you could find a way to catch the exception and add the data from the response? Because otherwise with errors like this you just have no clue what went wrong.
from mailgun.
@CupOfTea696 I'm glad you found the problem.
What kind of list 'address' did you create in the Mailgun Control Panel?
Never mind, you were creating a new list... :)
And which file did you change to get the error message?
from mailgun.
@CupOfTea696 I see you're already creating a PR on the mailgun/mailgun-php repo.
mailgun/mailgun-php#71 (comment)
They should probably do something like this:
public function responseHandler($responseObj){
$httpResponseCode = $responseObj->getStatusCode();
if($httpResponseCode === 200){
$data = (string) $responseObj->getBody();
$jsonResponseData = json_decode($data, false);
$result = new \stdClass();
// return response data as json if possible, raw if not
$result->http_response_body = $data && $jsonResponseData === null ? $data : $jsonResponseData;
}
elseif($httpResponseCode == 400){
$response = json_decode((string)$responseObj->getBody(), false);
if (isset($response->message)) {
throw new MissingRequiredParameters(EXCEPTION_MISSING_REQUIRED_PARAMETERS . " " . $response->message);
}
throw new MissingRequiredParameters(EXCEPTION_MISSING_REQUIRED_PARAMETERS);
}
elseif($httpResponseCode == 401){
throw new InvalidCredentials(EXCEPTION_INVALID_CREDENTIALS);
}
elseif($httpResponseCode == 404){
throw new MissingEndpoint(EXCEPTION_MISSING_ENDPOINT);
}
else{
throw new GenericHTTPError(EXCEPTION_GENERIC_HTTP_ERROR, $httpResponseCode, $responseObj->getBody());
}
$result->http_response_code = $httpResponseCode;
return $result;
}
from mailgun.
Yeah, that's pretty close to what I have. I'll create a pull request in a sec.
from mailgun.
@CupOfTea696 There is no need to add this to the EXCEPTION_INVALID_CREDENTIALS
and EXCEPTION_MISSING_ENDPOINT
these are fine the way they are. Just the EXCEPTION_MISSING_REQUIRED_PARAMETERS
should do.
from mailgun.
Trust me, I had a 404 error earlier which I wouldn't have figured out if it wasn't for the response data. It just said the url was wrong, while the actual problem was that I was trying to get() a list that didn't exist (because I thought you could check if the list existed that way but instead it throws this error).
from mailgun.
The InvalidCredentials
exception returns the message "Your credentials are incorrect."
which should be sufficient.
The MissingEndpoint
exception does return the message Mailing list [email protected] not found
when trying to get a non-existent resource.
But when you try to access a completely non-existent url/path like /test
you get the following response:
Which isn't really what you want.
from mailgun.
Hi @Bogardo ,
I faced same issue ("The parameters passed to the API were invalid. Check your inputs!") when I tried to add a domain that exists already in the same account. I updated responseHandler function to get correct error message. Just want to check whether the code is merged into main repo or not.
from mailgun.
Related Issues (20)
- Clarification please regarding handling of http_response_body content and possibly guzzle and/or env setting? HOT 3
- Undefined Method error
- Type error: Argument 1 passed must be an instance of App\Http\Controllers\Message HOT 1
- Example send email to mailing list HOT 1
- Troubles with the API request, deprecated usable of mailgun-php lib HOT 2
- .
- Trying to get property of non-object HOT 1
- Update nesbot/carbon dependency HOT 1
- Cannot install php-http/guzzle6-adapter HOT 2
- Switching endpoint HOT 2
- Using full api from mailgun-php HOT 2
- Install on Laravel 5.8? HOT 4
- ERROR when passing a variable to to() HOT 1
- new release 5.1.0 with Carbon 2 is not available via composer and isn't on packagist HOT 1
- Error installing this package on Laravel 5.8 (clunky workaround included...can we fix the package?) HOT 1
- Upgrade Laravel 6 HOT 1
- Unable to install php-http / guzzle6-adapter in symfony 4.1
- Emails are not being sent or received.
- Mailgun custom notification channel
- specific attachment to each recipient in batch emails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mailgun.