Swaroop relay
I tried to follow the recent tutorial posted by Dennis Ivy, huge respect. I am using appwrite cloud. The user is being created but the verification email is not being sent to the user.
TypeScript
"use server";
const data = Object.fromEntries(formData);
const { email, password } = data;
const { account } = await createAdminClient();
const user = await account.create(ID.unique(), email, password);
console.log(account);
await auth.createSession(formData);
await account.createVerification("https://localhost:3000/api/verify-email/");
redirect("/");```
Pasting createSession for reference
```createSession: async (formData) => {
"use server";
const data = Object.fromEntries(formData);
const { email, password } = data;
console.log(email, password);
const { account } = await createAdminClient();
const session = await account.createEmailPasswordSession(
email,
password
);
cookies().set("session", session.secret, {
httpOnly: true,
sameSite: "strict",
secure: true,
expires: new Date(session.expire),
path: "/",
});
redirect("/");
},```
Kindly help. Thank you, stuck for hours here. I am not using any custom SMTP servers or settings.
TL;DR
Issue: User account is being created successfully but the verification email is not being sent. The code snippets are provided for reference.
Solution: Add the `send` method after `account.createVerification()` to trigger the email sending process. This will resolve the problem of the verification email not being sent to the user. Swaroop relay
SSR email verification - not sending email to the user
Recommended threads
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...