Sending password reset email with Sendgrid?

Hello,

I just started using Sendgrid rather than letting Bubble send my emails. However, I’ve been trying to set up the “send reset password email” flow, but I can’t get it to work.

In the frontend, the reset token does not get passed through the email. Then when i try to pass it as a parameter, and run it as a backend workflow, it still doesn’t pass through.

How can I get the password reset token into the body text of the emails I’m sending?

Thanks a ton in advance!!

Hey @boilerplatetechnologi :waving_hand:

Have you watched this video yet? Password Reset Implementation with Postmark - #2 by maartenmg

It should help you out. :blush:

When using SendGrid manually, you need to generate the reset token yourself with the “Password reset” action, then include it in the email body like:
https://yourapp.com/reset-password?token=ThisUser's reset token.

Make sure the token is created before the email is sent, and passed properly from the backend if you’re triggering it from the frontend.

Exactly. Also, there’s a checkbox to generate the token without sending the email.

Yes I am doing this, but I mean the token isn’t being passed through. I’m adding 2 parameters to my backend workflows, (email & token). The email is being passed through to the backend, but the token is not. It’s just passing through an empty value for the token. Am I doing something wrong?

How exactly can I make sure the token is being passed through properly? I’m passing through both the email and the token. The email is being passed through properly, but the token is not being passed through at all. Perhaps it’s a security issue for the token? Am I doing it wrong??

I experienced this before and I identified it as a timing issue. That was mine.

What you should do first is to check your logs that the token is received by the action. What you can also do is check that the token is generated by creating a debug WF/action that passes the token to a state.

Best to share screenshots of your workflow.

1 Like

what I would do

  1. I’d probably try to save the token into a custom state and show it on the frontend - as a test - before pushing it to the backend workflow, just to check if it’s being correctly generated. Go to logs too, check step by step how things are rolling there.
  2. Check for empty data sources within your elements - Parent's group thing is often the workflow killer.
  3. I’d double-check this backend workflow.
  4. I’d check if this SendGrid integration is done right.

thanks to everyone for your help!! I ended up figuring it out, it was a timing issue like @ihsanzainal84 said. To solve the issue, i made sure to put the action that creates the token as a backend workflow action instead of in the frontend. : )

1 Like