Skip to content
Back

[SOLVED] How to invite user to team via Server SDK?

  • 1
  • Self Hosted
  • Teams
Nimit Savant
9 May, 2023, 02:38

I'm calling server sdk in my appwrite function, I want to add 100+ members to a team from server sdk and then also send them emails for invite. My question being is this possible with server sdk? This would be 1 time process.

TL;DR
The user wanted to know how to invite users to a team using the Server SDK. The solution is to create a cloud function that sends an email invitation to the user, and once they accept the invite, another function registers them and adds them to the team. Alternatively, the user can directly add the users to the team using the Server SDK, without sending an invitation.
Nimit Savant
9 May, 2023, 02:38

Currenly, I'm able to add the users but now able to send email

Drake
9 May, 2023, 02:45

Email invite for what?

Nimit Savant
9 May, 2023, 05:49

invite them to the organization team and then ask them to change password

Nimit Savant
9 May, 2023, 06:39

because invitation can only be send from client sdk thats what in the docs. But if I use client side, I'd be rate limited

Nimit Savant
9 May, 2023, 13:20

Hello Steven any suggestions?

Drake
9 May, 2023, 14:28

You're not really making use of Appwrite's team invitation feature so, if I were you, I'd create a function to send an email

Nimit Savant
9 May, 2023, 14:31

Yeah thought about this! And we could use our personal email to this. Why we're trying to use Appwrite teams here is because we want to a university to add their students and if we could directly create a membership for the team, the students would get an email and then they could change the password. Just how an lms functions.

Nimit Savant
9 May, 2023, 14:31

Can we not really send invitations from server sdk? I'm confused because, even in server sdk it was asking me for the URL to be sent to the users. So I was confused.

safwan
9 May, 2023, 14:38

With the served SDK, you can directly add the user to the team. You can't send them an invitation. It's just how Appwrite works currently.

safwan
9 May, 2023, 14:41

That being said, if you absolutely have to use the server SDK, you can deploy a cloud function that does the following:

  1. Get the user's email.
  2. Send an email to the user stating that they're invited to team 'ABC'.
  3. Once the user clicks the accept invite button, call another function that registers the user, and adds them to the team.
Drake
9 May, 2023, 14:44

via a client SDK, it sends them an invitation and they have to accept the invite in order to get added to the team. The server SDK allows you to force add the user into the team, without requiring them to accept it. That's why no email needs to be sent

Nimit Savant
9 May, 2023, 14:45

I think that clears my doubt thank you. I'll just use mailgun or something with functions to send email. Thanks Steven

Nimit Savant
10 May, 2023, 11:55

Someone can close this issue thank you :)

safwan
10 May, 2023, 12:01

[SOLVED] A way to invite members from server sdk?

safwan
10 May, 2023, 12:01

[SOLVED] How to invite user to team via Server SDK?

Drake
10 May, 2023, 17:44

FYI, you should be able to update the title yourself too

Nimit Savant
10 May, 2023, 18:38

Ohh didn't knew that

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more