### Install with Composer Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Install the package via Composer. ```bash composer require jeffersongoncalves/laravel-lemlist ``` -------------------------------- ### Campaigns API methods Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Campaign operations: list with pagination, get a single campaign, get stats, and export a campaign. ```php Lemlist::campaigns()->list(['limit' => 10, 'offset' => 0]); Lemlist::campaigns()->get('campaign-id'); Lemlist::campaigns()->stats('campaign-id'); Lemlist::campaigns()->export('campaign-id'); ``` -------------------------------- ### Leads API methods Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Lead operations: list, get, add, and delete leads within a campaign. ```php Lemlist::leads()->list('campaign-id', ['limit' => 10]); Lemlist::leads()->get('campaign-id', 'lead@acme.com'); Lemlist::leads()->add('campaign-id', 'lead@acme.com', [ 'first-name' => 'Jane', 'last-name' => 'Doe', 'company' => 'Acme', ]); Lemlist::leads()->delete('campaign-id', 'lead@acme.com'); ``` -------------------------------- ### Get team info Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Retrieve team information via the Team API. ```php Lemlist::team()->info(); ``` -------------------------------- ### Run static analysis Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Run static analysis. ```bash composer analyse ``` -------------------------------- ### Run tests Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Run the test suite. ```bash composer test ``` -------------------------------- ### Import Lemlist facade and exception Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Import the Lemlist facade and the LemlistException class for use in your application. ```php use JeffersonGoncalves\Lemlist\Facades\Lemlist; use JeffersonGoncalves\Lemlist\Exceptions\LemlistException; ``` -------------------------------- ### Config options (config/lemlist.php) Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Default configuration file for the package. The base_url defaults to the Lemlist API endpoint. ```php // config/lemlist.php return [ 'api_key' => env('LEMLIST_API_KEY'), 'base_url' => env('LEMLIST_BASE_URL', 'https://api.lemlist.com/api'), ]; ``` -------------------------------- ### Publish config file Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Optionally publish the package's config file. ```bash php artisan vendor:publish --tag="lemlist-config" ``` -------------------------------- ### Run code formatting Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Run code formatting. ```bash composer format ``` -------------------------------- ### Set LEMLIST_API_KEY in .env Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Add your Lemlist API key to the .env file. Find it under Settings → Integrations → API Key. ```env LEMLIST_API_KEY=your-api-key ``` -------------------------------- ### Activities API list Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md List activities, optionally filtered by campaign ID and type (e.g., emailsOpened). ```php Lemlist::activities()->list([ 'campaignId' => 'campaign-id', 'type' => 'emailsOpened', ]); ``` -------------------------------- ### Webhooks API methods Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Webhook operations: list, create, and delete webhooks. ```php Lemlist::webhooks()->list(); Lemlist::webhooks()->create('https://example.com/hook', 'emailsOpened'); Lemlist::webhooks()->delete('hook-id'); ``` -------------------------------- ### Unsubscribes API methods Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Unsubscribe operations: list, add, and delete unsubscribes. ```php Lemlist::unsubscribes()->list(['limit' => 10]); Lemlist::unsubscribes()->add('lead@acme.com'); Lemlist::unsubscribes()->delete('lead@acme.com'); ``` -------------------------------- ### Handling LemlistException Source: https://github.com/jeffersongoncalves/laravel-lemlist/blob/main/README.md Handle API errors by catching LemlistException. Use getMessage() for the error message and errorBody() for the full decoded JSON response. ```php try { $result = Lemlist::campaigns()->get('campaign-id'); } catch (LemlistException $e) { // $e->getMessage() — the API's error message, or the raw response body // $e->errorBody() — the full decoded JSON error response } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.