Skip to content
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

docs: Update docs for domain or email verification #1145

Merged
merged 1 commit into from Jun 16, 2020

Conversation

GeoFro
Copy link
Contributor

@GeoFro GeoFro commented Jun 13, 2020

If you are just testing this out in development and follow the instructions either here on github or inside the sendgrid web app it never mentions you must first verify a "from" domain or single address.

You will simply receive a 403 forbidden response on trying to send any mail, including the example email.
The error response does contain an error message though by default it won't be visible due to the way node simplifies deeply nested objects in console.log, as you can see below.

The actual error message does display if you know where to look error.response.body but at first glance and from the current docs you just think maybe your API keys aren't set up right.
One or two lines in the docs should prevent this.

ResponseError: Forbidden
    at node_modules/@sendgrid/client/src/classes/client.js:133:29
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  code: 403,
  response: {
    headers: {
      server: 'nginx',
      date: 'Fri, 12 Jun 2020 23:54:10 GMT',
      'content-type': 'application/json',
      'content-length': '281',
      connection: 'close',
      'access-control-allow-origin': 'https://sendgrid.api-docs.io',
      'access-control-allow-methods': 'POST',
      'access-control-allow-headers': 'Authorization, Content-Type, On-behalf-of, x-sg-elas-acl',
      'access-control-max-age': '600',
      'x-no-cors-reason': 'https://sendgrid.com/docs/Classroom/Basics/API/cors.html'
    },
    body: { errors: [Array] }
  }
}

I think some people will benefit from this PR including probably some people who found their way here

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the master branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

Update the docs to reflect the actual functionality.

If you are just testing this out in development and follow the instructions either here or inside the sendgrid web app it never mentions you must first verify a "from" domain or single address. 

You will simply receive a 403 forbidden response on trying to send any mail, including the example email.
The error response does contain an error message though by default it won't be visible due to the way node simplifies deeply nested objects in `console.log`, as you can see below.

```
ResponseError: Forbidden
    at node_modules/@sendgrid/client/src/classes/client.js:133:29
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  code: 403,
  response: {
    headers: {
      server: 'nginx',
      date: 'Fri, 12 Jun 2020 23:54:10 GMT',
      'content-type': 'application/json',
      'content-length': '281',
      connection: 'close',
      'access-control-allow-origin': 'https://sendgrid.api-docs.io',
      'access-control-allow-methods': 'POST',
      'access-control-allow-headers': 'Authorization, Content-Type, On-behalf-of, x-sg-elas-acl',
      'access-control-max-age': '600',
      'x-no-cors-reason': 'https://sendgrid.com/docs/Classroom/Basics/API/cors.html'
    },
    body: { errors: [Array] }
  }
}
```

By updating the docs, I think some people will benefit including probably [some people who found their way here](sendgrid#957)
@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Jun 13, 2020
Copy link
Contributor

@eshanholtz eshanholtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks so much for contributing!

@eshanholtz eshanholtz merged commit 8e025fe into sendgrid:master Jun 16, 2020
@GeoFro GeoFro deleted the patch-1 branch June 16, 2020 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: code review request requesting a community code review or review from Twilio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants