https://github.com/grevory/simple-php-mailing-list
A simple PHP/MySQL email collection class subscribing, unsubscribing, and getting all subscribers.
https://github.com/grevory/simple-php-mailing-list
Last synced: 3 months ago
JSON representation
A simple PHP/MySQL email collection class subscribing, unsubscribing, and getting all subscribers.
- Host: GitHub
- URL: https://github.com/grevory/simple-php-mailing-list
- Owner: grevory
- License: mit
- Created: 2015-04-12T06:20:28.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-19T18:24:13.000Z (about 10 years ago)
- Last Synced: 2025-01-17T05:27:15.648Z (5 months ago)
- Language: PHP
- Size: 148 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple PHP Mailing List Docs
## Initiate the class
```php
$mailingList = new SimpleMailingList();
```## Configure the DB
```php
$db = array(
'host'=>'localhost',
'username'=>'me',
'password'=>'mypassword',
'database'=>'dbname',
'table'=>'subscribers'
);
$mailingList->setDbConfig($db);
```## Subscribe a new email
```php
$mailingList->subscribe('[email protected]');
$mailingList->subscribe('[email protected]');
```## Unsubscribe an existing email
```php
$mailingList->unsubscribe('[email protected]');
```## Get a list of subscribers
```php
echo implode(', ',$mailingList->getAllSubscribers());
```## Get a list of subscribers including those who have opted out
```php
echo implode(', ',$mailingList->getAllSubscribers(true));
```## Check to see if an email is subscribed
```php
var_dump($mailingList->emailExists('[email protected]'));
```