Use this file to discover all available pages before exploring further.
The $lettr->campaigns() service gives you read access to your campaigns plus lifecycle actions — send now, schedule, and unschedule. Campaigns are created and edited in the Lettr dashboard; the API does not expose create, update, or delete.Reads require an API key with the campaigns:read scope; actions (send, schedule, unschedule) require campaigns:write.
$campaign->status is a CampaignStatus enum for known values, or the raw string for any future status the SDK doesn’t yet recognize — so a server-side enum addition can never break deserialization. The same applies to $event->eventType (EventType|string).
use Lettr\Dto\Campaign\ListCampaignEventsFilter;use Lettr\Enums\EventType;$cursor = null;do { $response = $lettr->campaigns()->events('0193e6a8-...', ListCampaignEventsFilter::create() ->eventType(EventType::Click) ->startDate(new DateTimeImmutable('-7 days')) ->cursor($cursor)); // null on the first iteration is fine foreach ($response->events as $event) { echo $event->email; echo $event->timestamp; echo $event->targetLinkUrl; // for click events } $cursor = $response->nextCursor;} while ($response->hasMore());
Accepts a DateTimeInterface (formatted to ISO-8601 with offset) or a raw string. Calling schedule() again on an already-scheduled campaign reschedules it.
$campaign = $lettr->campaigns()->schedule( '0193e6a8-...', new DateTimeImmutable('2026-06-01 09:00:00', new DateTimeZone('+02:00')),);// Or pass an ISO-8601 string$lettr->campaigns()->schedule('0193e6a8-...', '2026-06-02T09:00:00Z');