LaravelPackages.net
Acme Inc.
Toggle sidebar
rubenbuijs/mailcoach-api-wrapper

API wrapper to connect with a standalone Mailcoach server.

222
4
About rubenbuijs/mailcoach-api-wrapper

rubenbuijs/mailcoach-api-wrapper is a Laravel package for api wrapper to connect with a standalone mailcoach server.. It currently has 4 GitHub stars and 222 downloads on Packagist. Install it with composer require rubenbuijs/mailcoach-api-wrapper. Discover more Laravel packages by rubenbuijs or browse all Laravel packages to compare alternatives.

Last updated

Mailcoach API Wrapper

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.

Installation

A prerequisite is that you have installed Mailcoach as a standalone app.

You can install this package via composer:

composer require rubenbuijs/mailcoach-api-wrapper

Configuration

MAILCOACH_API_BASE_URL=https://yourdomain.com/api
MAILCOACH_API_TOKEN=1|XXXXXXXXXXXXXXXXXXXXXXX # Mailcoach installation: Config->API Tokens
MAILCOACH_LIST_ID=1
MAILCOACH_SSL=false

Usage

After installation, the Newsletter class is available to interact with your Mailcoach server.

Subscribe a new person

Newsletter::subscribe(string $email, string $name, array $tags = [])

Update a subscriber

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)

Add tag(s)

Newsletter::addTags(string $email, array $tags_to_add)

Delete tag(s)

Newsletter::deleteTags(string $email, array $tags_to_delete)

Retrieve subscriber data

Newsletter::getSubscriberByEmail(string $email)

Enjoyed this package?

Take a look at my products:

  • Boei: Website Lead, Communication & Social widget
  • ProductLift: World’s most flexible prioritization, roadmap, and changelog tool.
Comments