This is an API wrapper for Spatie's Mailcoach. Use this package when you have installed Mailcoach on a standalone server - separate from your app. I favored the standalone instance because it reduced dependencies in my apps.
A prerequisite is that you have installed Mailcoach as a standalone app.
You can install this package via composer:
composer require rubenbuijs/mailcoach-api-wrapperMAILCOACH_API_BASE_URL=https://yourdomain.com/api
MAILCOACH_API_TOKEN=1|XXXXXXXXXXXXXXXXXXXXXXX # Mailcoach installation: Config->API Tokens
MAILCOACH_LIST_ID=1
MAILCOACH_SSL=falseAfter installation, the Newsletter class is available to interact with your Mailcoach server.
Newsletter::subscribe(string $email, string $name, array $tags = [])Enter NULL when you don't want to make changes to the email, name, or tags.
Newsletter::update(string $email, string $new_email = null, string $name = null, array $tags = null)Newsletter::addTags(string $email, array $tags_to_add)Newsletter::deleteTags(string $email, array $tags_to_delete)Newsletter::getSubscriberByEmail(string $email)Take a look at my products:
- Boei: Website Lead, Communication & Social widget
- ProductLift: World’s most flexible prioritization, roadmap, and changelog tool.