[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
- Auth Error
"use client"; import { useEffect } from "react"; import { getSessionCookie } from "@/actions/auth"; import { createBrowserSessionClient } from "@/lib/appwrite-...
- Prevent modifying specific attributes
How do I prevent user to only to be able to modify some of the attributes. Document level security gives full access to update whole document, what are the wor...
- Bypass Error When Creating Account With ...
Suppose user first uses email/pass for log in using xyz@gmail.com, few month later on decides to use google oauth2 with same xyz@gmail.com (or in reverse orde...
