PHP code example of dansmaculotte / laravel-newsletter

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

    

dansmaculotte / laravel-newsletter example snippets


use Newsletter;

use Newsletter;

Newsletter::subscribe('[email protected]');

use Newsletter;

Newsletter::addMember('[email protected]');

Newsletter::unsubscribe('[email protected]');

Newsletter::subscribe('[email protected]', ['FNAME' => 'Rince', 'LNAME' => 'Wind']);

Newsletter::subscribe('[email protected]', ['FNAME' => 'Rince', 'LNAME' => 'Wind'], 'subscribers');

 Newsletter::subscribeOrUpdate('[email protected]', ['FNAME' => 'Foo', 'lastname' => 'Bar']);
 

Newsletter::unsubscribe('[email protected]', 'subscribers');

Newsletter::delete('[email protected]');

Newsletter::getMember('[email protected]');

Newsletter::hasMember('[email protected]'); //returns a boolean

Newsletter::isSubscribed('[email protected]'); //returns a boolean

Newsletter::getLastError();

$api = Newsletter::getApi();
bash
php artisan vendor:publish --provider="DansMaCulotte\Newsletter\NewsletterServiceProvider"
bash
composer