[SOLVED] Front-end flutter website sending password reset emails with appwrite using SMTP (mailjet)
- 0
- Resolved
- 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
- Appwrite (Dart SDK) (for package_info_pl...
Hi team! Many Flutter plugins now need package_info_plus 10.x and device_info_plus 13.x, but appwrite 25.4.0 still constrains package_info_plus: >=8.0.2 <10.0...
- How can I disable client-side account re...
Hi everyone! I’m currently building a game backend using Appwrite, and I’d like to prevent users from creating new accounts directly through the client. My go...
- relationships bug or error idk
hey every one, am using am using appwrite on a project and ran into a problem where by created a relationship and two way to be specific and it is stuck on proc...