Sha256: f5eb88c8bf099e6f954e87e9acc109cf3a4d3f7344249fcb18137262d2d69df4

Contents?: true

Size: 998 Bytes

Versions: 10

Compression:

Stored size: 998 Bytes

Contents

# Groups Examples

## Get list of groups

```ruby
client.groups
```

with options

```ruby
client.groups(limit: 5, offset: 10)
```

## Get single group by ID

```ruby
client.group(group_id)
```

## Create new group

```ruby
client.create_group(name)
```

## Remove a group
```ruby
client.delete_group(group_id)
```

## Get all subscribers in a specified group

```ruby
client.group_subscribers(group_id)
```

## Add new single subscriber to specified group

```ruby
subscriber = { email: 'subsriber@example.com' }
client.create_group_subscriber(1, subscriber)
```

## Add many new subscribers to specified group at once

```ruby
subscribers = [
  { email: 'subscriber1@example.com' },
  { email: 'subscriber2@example.com' }
]

client.import_group_subscribers(1, subscribers, resubscribe: true)
```

## Remove single subscriber from specified group

```ruby
client.delete_group_subscriber(group_id, 'demo@mailerlite.com')
```

or

```ruby
client.delete_group_subscriber(group_id, subscriber_id)
```

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mailerlite-1.16.0 examples/groups.md
mailerlite-1.15.0 examples/groups.md
mailerlite-1.14.0 examples/groups.md
mailerlite-1.13.1 examples/groups.md
mailerlite-1.13.0 examples/groups.md
mailerlite-1.12.0 examples/groups.md
mailerlite-1.11.0 examples/groups.md
mailerlite-1.10.0 examples/groups.md
mailerlite-1.9.0 examples/groups.md
mailerlite-1.8.0 examples/groups.md