Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mabasic/mailchimp
It subscribes an email address to your mailchimp list.
https://github.com/mabasic/mailchimp
laravel mailchimp php
Last synced: about 1 month ago
JSON representation
It subscribes an email address to your mailchimp list.
- Host: GitHub
- URL: https://github.com/mabasic/mailchimp
- Owner: mabasic
- License: mit
- Created: 2017-12-03T00:41:29.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-01T10:59:10.000Z (over 5 years ago)
- Last Synced: 2024-11-21T18:42:26.438Z (about 2 months ago)
- Topics: laravel, mailchimp, php
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Mailchimp
It subscribes an email address to your mailchimp list.
[![Become a Patron](https://img.shields.io/badge/Become%20a-Patron-f96854.svg?style=for-the-badge)](https://www.patreon.com/laravelista)
## Overview
This package can be used as a stand-alone package with any PHP framework or as a Laravel package.
## Installation
```
composer require mabasic/mailchimp
```## Usage
### Laravel
First, add this to your `config/services.php` file:
```php
'mailchimp' => [
'key' => env('MAILCHIMP_KEY'),
'dc' => env('MAILCHIMP_DATA_CENTER', 'us1')
]
```> **Hint!** You can even add your `list_id` above if you only use one list in your application.
Then, add the correct values in your `.env` file:
```
MAILCHIMP_KEY=
MAILCHIMP_DATA_CENTER=
```Finally, do this to subscribe an address:
```php
use Mabasic\Mailchimp\Facade as Mailchimp;Mailchimp::subscribeAnAddress($list_id, $email);
```### General PHP
```php
$mailchimp = new \Mabasic\Mailchimp\Mailchimp($key, $dc);$mailchimp->subscribeAnAddress($list_id, $email);
```## Tips
Read the source code for `src/Mailchimp.php` to better understand what `$dc` does and how to subscribe an address without a confirmation email. It is very educational.
## Laravelista Sponsors & Backers
I would like to extend my thanks to the following sponsors & backers for funding my open-source journey. If you are interested in becoming a sponsor or backer, please visit the Laravelista [Backers page](https://laravelista.hr/backers).
## Contributing
Thank you for considering contributing to mabasic/mailchimp! The contribution guide can be found on the [Laravelista website](https://laravelista.hr/contributing).
## Code of Conduct
In order to ensure that the Laravelista community is welcoming to all, please review and abide by the [Code of Conduct](https://laravelista.hr/code-of-conduct).
## License
mabasic/mailchimp is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).