Skip to content

Commit e97f817

Browse files
authored
Merge pull request #1 from anytech/main
Invite Member to Community
2 parents 34b6ee9 + a2118bd commit e97f817

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

src/Endpoint/Member/Members.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,28 @@ public function remove(string $email, ?int $communityId = null): mixed
146146
)
147147
);
148148
}
149+
150+
/**
151+
* Invite Member to Community
152+
*/
153+
public function invite(string $email, ?int $communityId = null): mixed {
154+
155+
$endpoint = "/community_members/";
156+
157+
$data = [
158+
'email' => $email,
159+
];
160+
161+
if (!empty($communityId)) {
162+
$this->ensureCommunityIdIsPresent($communityId);
163+
$data['community_id'] = $communityId;
164+
}
165+
166+
return $this->factorResponse(
167+
$this->circleSo->getHttpClient()->post(
168+
uri: $endpoint,
169+
body: json_encode($data),
170+
)
171+
);
172+
}
149173
}

0 commit comments

Comments
 (0)