PHP code example of tobymaxham / kraut-newsletter

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

    

tobymaxham / kraut-newsletter example snippets



// config/app.php
'providers' => [
    ...
    'TobyMaxham\Newsletter\NewsletterServiceProvider',
    ...
];


// Simply add a new subscriber.
Newsletter::subscribe('[email protected]');

// Attach the subscriber on a NewsletterList.
Newsletter::subscribe('[email protected]', 'Evil Mailing');

// Add some user informations
Newsletter::subscribe('[email protected]', ['firstname' => 'Heiko'], 'The Simple List');


// Remove from all Newsletter Lists and delete from subscriber
Newsletter::unsubscribe('[email protected]');

// Only remove from a special list
Newsletter::unsubscribe('[email protected]', 'Free Tutorials');