sokratesliOriginal post
Web Developer
I execute the following command in the nodejs server sdk:
const createNewMember = await teams.createMembership(teamId, [], '', userId);
roles = empty array
email = empty string
I get the following error message: "Invalid email parameter: Value must be a valid email address"
However, in the documentation under "TeamsApi/createMembership" it says: "You only need to enter one of the following: User ID, email or phone number. Appwrite will primarily accept the user ID > email > phone number if you specify more than one of these parameters."
Why do I still need the email?
Summary
Developers are trying to use the `createMembership` function in the Node.js server SDK without specifying an email address, as mentioned in the documentation. However, they are encountering an error message stating that a valid email address is required. They are confused as to why they still need to provide an email when the documentation suggests otherwise.
Solution: It seems the documentation might be incorrect. To resolve this issue, developers will need to provide a valid email address when using the `createMembership` function.