sendlix
    Preparing search index...

    Class GroupClient

    GroupClient is a client for managing group operations via gRPC. It provides methods for inserting and deleting emails from groups.

    Hierarchy

    • Client<typeof gRpcGroupClient>
      • GroupClient
    Index
    • Constructs a new GroupClient instance.

      Parameters

      • Optionalauth: string | IAuth

        Authentication object implementing IAuth or a raw token string.

      Returns GroupClient

    • Closes the client connection Should be called when the client is no longer needed to free resources

      Returns void

    • Checks whether an email exists in a group.

      Parameters

      • groupId: string

        The unique identifier of the group.

      • email: string

        The email address to check.

      Returns Promise<boolean>

      Promise that resolves to true if the email exists in the group; false otherwise.

    • Deletes an email from a group.

      Important: Emails can only be removed if they were added at least 30 minutes ago.

      Parameters

      • groupId: string

        The unique identifier of the group.

      • email: string

        The email address to remove from the group.

      Returns Promise<boolean>

      Promise that resolves to true on success, otherwise rejects with an Error.

      const client = new GroupClient("your_api_key");
      await client.deleteEmailFromGroup("groupId", "info@example.com");
    • Inserts one or multiple email records into a group.

      Parameters

      • groupId: string

        The unique identifier of the group.

      • email: EmailRecord | EmailRecord[]

        A single EmailRecord or an array of EmailRecord objects.

      • failHandling: "SKIP" | "ABORT" = "ABORT"

        Strategy on individual insert failure. One of the keys of FailureHandler (e.g. "ABORT").

      Returns Promise<boolean>

      Promise that resolves to true on success, otherwise rejects with an Error.

      const client = new GroupClient("your_api_key");
      // Single email as simple string
      await client.insertEmailIntoGroup("groupId", { email: "info@example.com" });

      // With display name and substitutions
      await client.insertEmailIntoGroup("groupId", {
      email: { email: "john@example.com", name: "John Doe" },
      substitutions: { firstName: "John" }
      });

      // Multiple records
      await client.insertEmailIntoGroup("groupId", [
      { email: "a@example.com" },
      { email: { email: "b@example.com", name: "User B" }, substitutions: { plan: "pro" } },
      ]);