PHP code example of offline-agency / laravel-email-chef

1. Go to this page and download the library: Download offline-agency/laravel-email-chef library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

offline-agency / laravel-email-chef example snippets


return [
    'baseUrl' => 'https://app.emailchef.com/apps/api/v1/',

    'login_url' => 'https://app.emailchef.com/api/',

    'username' =>  env('EMAIL_CHEF_USERNAME'),

    'password' => env('EMAIL_CHEF_PASSWORD'),

    'list_id' => '97322',
    
    'contact_id' => '656023'
];

$laravel-email-chef = new OfflineAgency\LaravelEmailChef();
echo $laravel-email-chef->echoPhrase('Hello, OfflineAgency!');

//List create
$list = new ListsApi();
$list->create([
    'list_name' => 'OA list name',
    'list_description' => 'description'
]);

//List unsubscribe
$list = new ListsApi();
$list->unsubscribe(
    97322, //list_id
    53998920 //contact_id
);

//Contacts get count
$contacts = new ContactsApi;
$contacts->count(config('email-chef.list_id'));
bash
php artisan vendor:publish --provider="OfflineAgency\LaravelEmailChef\LaravelEmailChefServiceProvider" --tag="laravel-email-chef-migrations"
bash
php artisan vendor:publish --provider="OfflineAgency\LaravelEmailChef\LaravelEmailChefServiceProvider" --tag="laravel-email-chef-config"