[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
- Collection Permission issue
I am facing issue in my Pro account. "Add" button is disabled while adding permission in DB collection settings.
- Opened my website after long time and Ba...
I built a website around a year back and and used appwrite for making the backend. At that time the website was working fine but now when i open it the images a...
- Is it possible to cancel an ongoing file...
When uploading a file to storage, is there a way to cancel the upload in progress so the file is not saved or partially stored?
