Verify email link SendGrid

await Moralis.Cloud.run(“sendWelcomeEmail”, {email, username});

Ran cloud function sendWelcomeEmail for user 25VqzDp5t6XlBWKcbJB12lHj with:
Input: {“email":"[email protected]”,“username”:“thutch”}
Result: undefined

Have everything working fine except I can’t figure out how to get the SendGrid button link click to change the emailVerified result to true in the Moralis Database.

If anyone knows how to fix this please let me know.

serverURL: https://4nunoqoexvrk.usemoralis.com:2053/server

Thanks!

How does the link that you send to the user to click on look like?

Made a custom one on SendGrid.

I mean that link on you click on verify email now how it looks like or what it does.

It doesn’t naturally inherit anything I passed it a url param from the cloud function. But
I just made it go to the home page. How could I pass it a param that would set the current users emailVerified to be true?

How did you made it to go to the home page, as in how does the code that did that look?

Screen Shot 2021-09-07 at 1.48.45 AM

Through this cloud function. And then on SendGrid I just put URL in {{ }}.

I don’t know what is the best option, maybe you can set as url a call to another cloud function and try to send parameters as ?token_id=3234qw34234324, with localhost you can try for now with http://localhost:3000/?token_id=34234234weaerear and then you could replace localhost:3000 with a call to one of your cloud functions that will check that token_id.
Maybe there are better options.
By a call to one of your cloud functions I mean a url that points to one of your cloud functions.

are there cloud functions that can set user data in the database? I don’t need it to point to a link, just need it to run a function.

You can create a cloud function that can set user data in the database. By default a cloud function can use {useMasterKey: true} in order to be able to update/modify any table data.

1 Like