inviteUserByEmail method

Future<UserResponse> inviteUserByEmail(
  1. String email, {
  2. String? redirectTo,
  3. Map<String, dynamic>? data,
})

Sends an invite link to an email address.

Implementation

Future<UserResponse> inviteUserByEmail(
  String email, {
  String? redirectTo,
  Map<String, dynamic>? data,
}) async {
  final body = {'email': email};
  final fetchOptions = GotrueRequestOptions(
    headers: _headers,
    body: body,
    redirectTo: redirectTo,
  );

  final response = await _fetch.request(
    '$_url/invite',
    RequestMethodType.post,
    options: fetchOptions,
  );
  return UserResponse.fromJson(response);
}