Skip to content

Getting empty response after sending emails using PHP API library #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
srinivasoztek opened this issue Feb 8, 2017 · 10 comments
Closed
Labels
type: question question directed at the library

Comments

@srinivasoztek
Copy link

Hi There,

As per the discussion (https://support.sendgrid.com/hc/en-us/requests/893404) with one of support team member Bogdan and he requested to submit an issue here.

We are using sendgrid PHP API to send emails from our application. It is working as expected but in sometimes we are getting an empty response from the sendgrid server. Based on the response we built some logic for our end user. If the empty response is received then we are unable to handle the case.

We are using the endpoint "https://api.sendgrid.com/api/mail.send.json" to send the emails and we should receive the response in JSON format if something got the response from the sendgrid server.

Technical details:

  • sendgrid-php Version: Older version
  • PHP Version: 5.4.40

Attached our sample code samplecode.zip in zip format, please feel free to explore the code to find the issues.

Could you please someone look into this issue and let us know the fix as soon as possible?

Thanks,
Srinivas

@thinkingserious thinkingserious added the type: question question directed at the library label Feb 9, 2017
@thinkingserious
Copy link
Contributor

Hello @srinivasoztek,

We are no longer supporting versions previous to v5 of this library.

That said, I don't believe that the library is causing this issue.

Do you know in what cases you receive an empty response? It may help to isolate in which cases you receive the response vs. not.

Thanks!

With Best Regards,

Elmer

@srinivasoztek
Copy link
Author

Hi Elmer,

Thanks for looking into it. Actually, there is no particular case for getting an empty response. It is working always but sometimes suddenly getting an empty response for a couple of times. After some time again it will work when we sent the email again.

Could you please let us know what is the cause for this type of issues?

Thanks,
Srinivas

@thinkingserious
Copy link
Contributor

Hello Srinivas,

I'm guessing that the requests that don't receive a response are probably timing out.

I suggest you check your Activity Feed to help verify. If you see that the email was processed, but the API did not return a response, then there may be an issue with the API. Otherwise, if you don't see that the email was processed either, then it's likely a timeout issue.

@srinivasoztek
Copy link
Author

Hi Elmer,

Thanks again for looking into this. The emails are appearing in activity feed but we got the empty response, this is one issue we faced several times.

In some cases, emails are not appearing in the activity feed and as well as receiving an empty response from the SendGrid. As you said this is the timeout issue. In this cases what actions we need to take here? Could you please share your thoughts on this?

Thanks,
Srinivas

@thinkingserious
Copy link
Contributor

Hi @srinivasoztek,

We need to get this issue implemented so that you can pass in a custom timeout value: #356

Could you please give that issue a vote to help get it prioritized higher in our backlog? Thanks!

@srinivasoztek
Copy link
Author

Hi @thinkingserious,

Thanks for the update. I have just followed up the doc here https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments to vote #356. If this is not the process to vote, please provide the steps or doc how to vote to the issue.

Thanks,
Srinivas

@thinkingserious
Copy link
Contributor

Perfect, thank you @srinivasoztek!

@edgarjp
Copy link

edgarjp commented Feb 20, 2017

Hi Elmer,

My name is Edgar and I'm helping Srinivas find out how we can resolve this issue. We had a couple more outages last week which are affecting our customers, so anything you can do to help us figure out what's going on would be greatly appreciated. Here's a recap of the situation to try and get us all on the same page.

We are using the following endpoint to send out emails for our customers: https://api.sendgrid.com/api/mail.send.json

We've been having intermittent issues that no one has been able to get to the bottom of as of yet. The latest two incidents occurred on February 14th 6:10 - 6:25pm, and February 19th 6:30 - 6:40pm Pacific Standard Time. During these times all calls to that endpoint returned an empty string "".

There isn't a timeout or a specific error that we can see, we just get an empty response back. Please correct me if I'm wrong, but if it was timing out we would get no response back on our end, right?

Here's a list of the emails that came back with empty responses:

[since this is a public forum I didn't want to just provide the email addresses, but can email them to you if needed. They all don't show up in the activity feed, until they are manually re-queued and sent successfully, which I've summarized below.]

Because we want to make sure these emails are being delivered, they get re-queued and we attempt to send again. If they fail a second time we manually have to re-queue them. For these emails above they all failed twice and had to be manually re-queued, which went through without issue a few hours later. The activity feed only shows the manual re-queue events going through at around 9:00pm on February 14th.

We had the same issue occur yesterday (Sunday, February 19th, between 6:30 - 6:40pm Pacific Time). It followed the same process, where it fails twice, we get notified, and then they go through fine later on when we manually resend them.

From what I can tell from the situation I'm not sure that adding a custom timeout value parameter to this end point as suggested actually solves our issue, as these calls aren't timing out on our end. We're just getting an empty response back. Could you explain how this proposed solution would help us out?

Also, what are the possible reasons we could be getting an empty response back? Have other customers experienced this same thing? We can't recreate this with our testing, so is there any information we can provide so you can help us find the root cause of these issues that keep affecting our customers?

Again not to beat a dead horse, but this issue keeps happening, it's affecting our customers, and as a result the level of service we can provide as a Stripe customer is lacking. Adding this as a one off solution to a backlogged list of fixes with no estimated completion date doesn't seem like a good solution either, so we're hoping we can find another solution here.

Thanks for your time and attention and helping us resolve this issue, and please let me know if I can provide any more information to help clarify what's going on.

Thanks,

  • Edgar

@thinkingserious
Copy link
Contributor

Hi @edgarjp,

I believe this issue goes beyond what I'm able to support, so I will circle back with our support team to get you the help you need.

With Best Regards,

Elmer

@edgarjp
Copy link

edgarjp commented Feb 21, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question question directed at the library
Projects
None yet
Development

No branches or pull requests

3 participants