PHP code example of piedweb / tiny-maillist-builder

1. Go to this page and download the library: Download piedweb/tiny-maillist-builder 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/ */

    

piedweb / tiny-maillist-builder example snippets

 php
ader("Access-Control-Allow-Origin: *");

if ($_SERVER['REQUEST_METHOD'] === 'POST')
{
    $list = new TinyMailListBuilder(['piedweb'], 'list');
    if ($list->add(trim($_POST['email'] ?? ''), $_POST['list'] ?? '')) {
        exit('OK');
    } else {
        exit('EVER');
    }

} else {
    header("HTTP/1.1 401 Unauthorized");
    exit('ERROR');
}