Skip to content

Commit 58f77b5

Browse files
readme update
1 parent 51011ef commit 58f77b5

2 files changed

Lines changed: 48 additions & 9 deletions

File tree

README.md

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,68 @@
1-
This SDK is organized around resources.
1+
# Listmonk PHP
22

3-
## Usage
3+
A PHP SDK for the [Listmonk](https://listmonk.app) email platform.
4+
5+
[![CI](https://github.com/dynamik-dev/listmonk-php/actions/workflows/CI.yml/badge.svg)](https://github.com/dynamik-dev/listmonk-php/actions/workflows/CI.yml)
6+
7+
## Requirements
8+
9+
- PHP 8.4+
10+
11+
## Installation
12+
13+
```bash
14+
composer require dynamik-dev/listmonk-php
15+
```
16+
17+
## Quick Start
418

519
```php
620
use DynamikDev\Listmonk\Listmonk;
721

822
$listmonk = new Listmonk(
923
baseUrl: 'https://listmonk.example.com',
10-
username: 'admin',
11-
password: 'secret',
24+
username: 'api',
25+
password: 'your-api-token',
1226
);
1327
```
1428

15-
Create a subscriber:
29+
### Create a subscriber
1630

1731
```php
18-
$listmonk->subscribers()->create(
32+
$subscriber = $listmonk->subscribers()->create(
1933
email: 'user@example.com',
2034
name: 'John Doe',
2135
lists: [1, 2],
2236
);
2337
```
2438

25-
Get all campaigns:
39+
### Send a campaign
40+
41+
```php
42+
$campaign = $listmonk->campaigns()->create(
43+
name: 'Welcome Campaign',
44+
subject: 'Welcome to our newsletter!',
45+
lists: [1],
46+
body: '<p>Hello {{ .Subscriber.Name }}!</p>',
47+
);
48+
49+
$listmonk->campaigns()->start($campaign->id);
50+
```
51+
52+
### Public subscription (no auth required)
2653

2754
```php
28-
$listmonk->campaigns()->list();
55+
$listmonk->public()->subscribe(
56+
email: 'user@example.com',
57+
name: 'John Doe',
58+
listUuids: ['abc-123-def'],
59+
);
2960
```
61+
62+
## Documentation
63+
64+
For full documentation, visit [docs.dynamik.dev/listmonk-php](https://docs.dynamik.dev/listmonk-php)
65+
66+
## License
67+
68+
MIT

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "dynamik-dev/listmonk-php-client",
2+
"name": "dynamik-dev/listmonk-php",
33
"description": "A full-featured PHP HTTP client for the Listmonk email platform",
44
"type": "library",
55
"license": "MIT",

0 commit comments

Comments
 (0)