How can I fetch an UID based on an email, when the user is logged out? This is so users can recover their password?
In the documentation there is a request called “create password recovery” and “create password recovery confirmation”. The first request requires an email and userid. The second request requires the userid, secret, password, and passwordAgain.
For our current flow, users go to the forgot page link where they enter their email and are sent an email with a redirect link to create a new password. The redirect link prompts them to enter their new password.
The Appwrite documentation requests require a secret and a user Id. So my current question is figuring out how I can generate the userId when they are not logged in? The second question is if a secret is necessary for this process?
The first request requires an email and userid.
It only requires an email and url 🧐 https://appwrite.io/docs/client/account?sdk=web-default#accountCreateRecovery
For our current flow, users go to the forgot page link where they enter their email and are sent an email with a redirect link to create a new password. The redirect link prompts them to enter their new password.
Correct, this is the exact intended workflow using Appwrite.
So my current question is figuring out how I can generate the userId when they are not logged in?
It's in the URL in the email
The second question is if a secret is necessary for this process?
Yes, of course. That's how Appwrite verifies the user...
Is there an additional function that I need to use to be able to generate the secret key?
no...it's in the URL in the email
Okay thank you, and for the first request how can I retrieve the userid? Since the user is not logged in. Is there a certain request or call I can use to get the userid?
you don't need the user id
Quick question for you Steven, does Appwrite handle sending emails when I call the create recovery function, or do I need to integrate a 3rd party servide/tool like mail jet to do that?
Is there also a way to edit and modify the email template so it can look the way we’d like it to look?
are you on cloud or self-hosted?
Self hosted on digital ocean
then you need to configure the SMTP env vars.
There's no out of hte box way to modify the email template yet. however, you can mount in a modified version of this https://github.com/appwrite/appwrite/blob/master/app/config/locale/templates/email-base.tpl
So if the SMTP env vars are configured will it mean that the request "createRecovery" will send out emails with no need for a 3rd party tool or service? Does appwrite take care of this?
Did you look at the SMTP vars?
I had a look, thank you!
The SMTP provider would be a 3rd party service...
Thank you, in that case I’d also like to ask if there is a need for an SMTP provider when Appwrite is self-hosted versus when it is not self-hosted?
In Appwrite cloud, SMTP is already configured for you
Thank you!
I have a follow-up question about this. I am using MailJet as a SMTP service to send out emails. In order to configure SMTP I have configured some vars in my .env file. I would like to ask how I can integrate a specific transactional email template if possible using an ID number? Would that be something you have knowledge of? Is there like a var I could enter in the .env file in order to do this?
Additionally, I would like to ask..If I decide to instead of using SMTP, create an API service using Mailjet that I host on a 3rd party service that is accessible by endpoint to send out emails using, how can I configure this with my appwrite, so that my mailjet api call can be combined with the "createRecovery" request, and provide that redirect url link containing the secret key + userid in the mailjet email?
I'm not sure what you mean by transactional id.
We only support SMTP.
Transaction ID is just the template ID on mailjet
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...