-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 Cloud Code Module #554
Comments
Dylan, |
Yes, I was.
Note that instead of initializing Sendgrid with your username and password, I recommend you make an API key from the dashboard and use that instead. Should work from there, lmk how it goes. |
Thank you @dcdspace. I've since been able to require sendgrid in my projects although that didn't seem to help for sending password reset messages. I see you ran into a similar problem in issue #275. I've setup the parse-server-sendgrid-adapter (#971) to basic success - that is, I can send reset messages but the reset link doesn't work and I get "undefined" fields as shown below: Have you been able to successfully send password resets? EDIT ** |
No @zeluspudding I've only been using Sendgrid with custom templates for transactional email such as for welcome messages and in addition to push notifications for friend requests. I would however love to use my custom templates for a password reset/email verification email, so it would be great if we could directly access the reset link, and be allowed to customize the reset page. I'm also not |
@dcdspace, It appears "adapter" is synonymous with "wrapper" as |
After a little more poking around I've come across this - gaze your eyes upon the following: So the fields pointed out by the number 1 in Pane A are indeed set by the appName argument when initializing ParseServer in the index.js. If you take a look at that source you can see that appName is the third argument to the |
Hey guys I have followed the digital oceans guideline to migrate my application from this link : now my application uses sendgrid to send very basic text emails. I have tested my cloud code without sendgrid and it works fine. For my cloud code file it looks something like this : now whenever I try to run this sendMail function through postman I get an internal server error : If I click the send button multiple times I sometimes get a 502 Bad Gateway error : Now I figured that its the sendgrid that is throwing this error so I tried to install sendgrid on my droplet. I logged in as parse user
and created a package.json and added the following to it
i still get the same error message. I tried to install sendgripd globally as root on the droplet as well but it did not help my cloud code run
I have looked around the internet and haven't found anything as close as this thread to my problem so if any of you guys know how I can fix this I will be greateful as this is the only step left for my application migration. Cheers, |
Can you enable verbose logging in your server, trigger the error, and post a new issue with the output? |
I'm sorry but Im not sure where I can find the log file. I have a file ecosystem.json which has parse-wrapper information. Is that the file where I should add VERBOSE = 1 ? I did a parse-server command in my droplet command-line saw this in the output : So I went to my ecosystem.json file and edited it and now it loks something like this (did I set the verbose correctly ? or do I have to set it like VERBOSE=1 and what about the quotes ): I ran the following command
and I guess it restarted my parse-wrapper I can not find the log files for the parse-server on my droplet. Do you know the exact location for the log file ? I tried to look around and found nginx log files under /var/log/nginx/error.log. Since I am using nginx according to Digital Ocean's tutorial, I thought that might also help. This is what I saw in its error logs :
Thanks 😄 |
So I looked up at pm2 and to see real-time logs the command is
at first when I ran the command I saw some errors, maybe they were there from before : Then I tried the hello cloud function from postman app to test for its output in pm2 logs and I got the following : Next I try to run my sendMail sendgrid function and I find out the the api-key I had used in my sendgrid function was throwing an error So I went back to my cloud code and used quotes around my api-key parameter and passed it as a string in my send grid initialize function. Then I retry and get
So I went back to my sendgrid account and made sure that the api-key I was using was the correct one and it seemed to be just fine. I tested again and got the same error again so I decided to generate a new api-key just in case. So I realize that I was not using the api-key but instead API KEY ID : When we create a new api-key on sendgrid they give us the actual api key once and they ask us to store it in some secure place :
So after I used an actual api-key I was able to send emails 😃 But one small issue still remains and I am not sure if its because of postman that I am using to run cloud code or something in the parse server or nginx that is still returning me with a 502 Bad Gateway as a response But when I look at the logs for my parse server I do see a
but it never gets back to me in my postman and instead i am getting a 502 error not sure why Thanks for helping me debug |
This is expected. Also, now that you've posted your API keys, you should rotate them, or anyone can look at this page and send emails as your account. |
Oh, my bad. Totally missed it. thanks :) |
Since Cloud Code doesn't support modules anymore, how can I still use an email service like Sendgrid to send transactional email? Right now I am using its cloud code module, but that does not work in Parse Server. Thanks for the help.
The text was updated successfully, but these errors were encountered: