[SOLVED] Front-end flutter website sending password reset emails with appwrite using SMTP (mailjet)
- 0
- Users
- Flutter
- Web

Future sendPasswordReset(String email) async { try { await Account(client).createRecovery( email: email, url: 'edventures-url', // Use the full URL ); print('Password reset email sent successfully'); } catch (e) { print('Failed to send password reset email: $e'); throw e; } }
// password reset function Future passwordReset(String userId, String secret, String password, String confirmPassword) async { try { await account.updateRecovery( userId: 'userId', secret: 'secret', password: password, passwordAgain: confirmPassword ); print('Password reset successful'); } catch (e) { print('Failed to reset password: $e'); throw e; } }

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.

The "edventures-url" has the demo.edventures.ai domain or localhost?

Demo.Edventures.ai

Are you 100% sure it's that?

that looks like a literal string 👀 not a variable or URL

Ahh I see that makes sense, thank you for catching that! Might have been the issue. Thank you for the help! I’ll reach out if it doesn’t work.

Tell us if changing it to you URL solves everything to mark this as solved 😄

So i've gone ahead and changed the url so that it looks like this now but I still get the same error:
Future sendPasswordReset(String email) async { try { await Account(client).createRecovery( email: email, url: 'demo.edventures.ai', // Use the full URL ); print('Password reset email sent successfully'); } catch (e) { print('Failed to send password reset email: $e'); throw e; } }

can you tey adding the protocol as well?


Does it need to be https or can I use http? Cause we currently do not have SSL set up on the droplet at the moment.

yeah http should be okay

Thank you, i'll give it a try

let me know

Also does this url need to be in quotations?

yep

It worked! Thank you!!
I have another question for you if possible? I'd like some guidance on how I can fix this situation here:
The reset email currently looks like this:
Flutter Webapp (Alpha) Team
Hello Taha Follow this link to reset your Flutter Webapp (Alpha) password. (URL LINK) If you didn’t ask to reset your password, you can ignore this message. Thanks Flutter Webapp (Alpha) team
How can I change the first line, that says Flutter Webapp (Alpha) Team to "Team Edventures"? I'd also like to change the second mention of "Flutter Webapp (Alpha) password" to "Edventures password", and the last mention of it in "Thanks Flutter Webapp (Alpha) team" to "Team Edventures".

Afaik, this is in works to allow devs. to customize the email templates. See: https://github.com/appwrite/appwrite/issues/3147 & RFC: https://github.com/appwrite/rfc/blob/b2b9e3a8ae23cd2511d36f883b26adb3152d8842/022-custom-smtp-and-email-templates.md

Ahh so it is currently not available?

You could basically change the template, but that would be at the source files levels. But this may require you to edit the source templates on every appwrite update as they would be overriden, i guess.

Thank you darShan!

no worries 🙂

Yes! Coming in next version (1.4)

[SOLVED] Front-end flutter website sending password reset emails with appwrite using SMTP (mailjet)
Recommended threads
- Subdomain failed verification
So I wanted to do a custom subdomain, because local storage doesn't work for me, but I've tried it a long time ago, it didn't work for me, and now I'm trying ag...
- Sites 30MB limit from GitHub
I’m deploying a site from github as Other type on the Hobby plan. It is actually a Flutter web app but it’s in a subdirectory with the root being an html landin...
- [Node.js SDK] Bypass 2GB file limit?
Hello. Using either InputFile.fromPath or InputFile.fromBuffer throws this error: File size (2295467305) is greater than 2 GiB Bucket limit etc. is setup corre...
