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

Sendgrid axios.post('/api/surveys', survey) not working even after changing updated Mailer.js from udemy Q&A #57

Open
proust01 opened this issue Aug 18, 2019 · 0 comments

Comments

@proust01
Copy link

proust01 commented Aug 18, 2019

Hi, Stephen. thanks for all these support. I've been struggling test sending survey object with axios according to lecture 139 but even after updating new Mailer.js file, according to Martin from Q&A, it still doesn't work. This is error I got in my terminal.

and this is my github link :
https://github.com/proust01/emaily/blob/master/services/Mailer.js

[0] (node:14108) UnhandledPromiseRejectionWarning: Error: Expecting object for Mail data
[0] at Mail.fromData (C:\Users\David Cho\react-node\node_modules@sendgrid\helpers\classes\mail.js:55:13)
[0] at new Mail (C:\Users\David Cho\react-node\node_modules@sendgrid\helpers\classes\mail.js:44:12)
[0] at Function.create (C:\Users\David Cho\react-node\node_modules@sendgrid\helpers\classes\mail.js:627:12)
[0] at MailService.send (C:\Users\David Cho\react-node\node_modules@sendgrid\mail\src\classes\mail-service.js:174:25)
[0] at Mailer.send (C:\Users\David Cho\react-node\services\Mailer.js:28:29)
[0] at app.post (C:\Users\David Cho\react-node\routes\surveyRoutes.js:26:17)
[0] at Layer.handle [as handle_request] (C:\Users\David Cho\react-node\node_modules\express\lib\router\layer.js:95:5)
[0] at next (C:\Users\David Cho\react-node\node_modules\express\lib\router\route.js:137:13)
[0] at module.exports (C:\Users\David Cho\react-node\middlewares\requireCredits.js:5:5)
[0] at Layer.handle [as handle_request] (C:\Users\David Cho\react-node\node_modules\express\lib\router\layer.js:95:5)
[0] at next (C:\Users\David Cho\react-node\node_modules\express\lib\router\route.js:137:13)
[0] at module.exports (C:\Users\David Cho\react-node\middlewares\requireLogin.js:5:5)
[0] at Layer.handle [as handle_request] (C:\Users\David Cho\react-node\node_modules\express\lib\router\layer.js:95:5)
[0] at next (C:\Users\David Cho\react-node\node_modules\express\lib\router\route.js:137:13)
[0] at Route.dispatch (C:\Users\David Cho\react-node\node_modules\express\lib\router\route.js:112:3)
[0] at Layer.handle [as handle_request] (C:\Users\David Cho\react-node\node_modules\express\lib\router\layer.js:95:5)
[0] (node:14108) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant