PHP code example of minutemailer / api

1. Go to this page and download the library: Download minutemailer/api 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/ */

    

minutemailer / api example snippets




onalAccessToken = 'myAccessToken';

$client = new Minutemailer\Minutemailer($personalAccessToken);

// Create new contact and add it to list
$response = $client->contacts()->create('[email protected]', ['first_name' => 'Firstname', 'last_name' => 'Lastname'], ['123abc']);

$contact_id = $response->id;

// Add existing contact to list
$response = $client->contact_lists('123abc')->addContact($contact_id);

// Resubscribe unsubscribed contact
$response = $client->contacts($contact_id)->update(['status' => 1]);