All Projects → mailerlite → Mailerlite Api V2 Php Sdk

mailerlite / Mailerlite Api V2 Php Sdk

Licence: mit
Official PHP wrapper for MailerLite HTTP API v2

Projects that are alternatives of or similar to Mailerlite Api V2 Php Sdk

Awesome Emails
✉️ An awesome list of resources to build better emails.
Stars: ✭ 1,379 (+2658%)
Mutual labels:  email-marketing, email
Dotmailer Magento2 Extension
The official Engagement Cloud for Magento2 extension
Stars: ✭ 33 (-34%)
Mutual labels:  email-marketing, email
Mosaico
Mosaico - Responsive Email Template Editor
Stars: ✭ 1,392 (+2684%)
Mutual labels:  email-marketing, email
Responsive Html Email Template
A free simple responsive HTML email template
Stars: ✭ 10,831 (+21562%)
Mutual labels:  email-marketing, email
Notifo
Multi channel notification service for collaboration tools, e-commerce, news service and more.
Stars: ✭ 32 (-36%)
Mutual labels:  email-marketing, email
Pine
A modular and lightweight, responsive email framework.
Stars: ✭ 98 (+96%)
Mutual labels:  email-marketing, email
Html Email Templates
Free HTML Email Templates created using the Postcards - https://designmodo.com/postcards/
Stars: ✭ 178 (+256%)
Mutual labels:  email-marketing, email
Email Extractor
The main functionality is to extract all the emails from one or several URLs - La funcionalidad principal es extraer todos los correos electrónicos de una o varias Url
Stars: ✭ 81 (+62%)
Mutual labels:  email-marketing, email
bulk-email-sender
Send Templatized Dynamic Emails Automatically
Stars: ✭ 30 (-40%)
Mutual labels:  email, email-marketing
React Email Editor
Drag-n-Drop Email Editor Component for React.js
Stars: ✭ 3,131 (+6162%)
Mutual labels:  email-marketing, email
Email Dashboard
📪 An interactive emailing management service with scheduling, templating, tracking and A/B testing.
Stars: ✭ 194 (+288%)
Mutual labels:  email-marketing, email
Mjml React
React component library to generate the HTML emails on the fly
Stars: ✭ 257 (+414%)
Mutual labels:  email-marketing, email
news-api
Go newsletter API backed by DynamoDB
Stars: ✭ 63 (+26%)
Mutual labels:  email, email-marketing
Paperboy
💌💨 Email Campaign Delivery built with GoLang inspired by GoHugo
Stars: ✭ 411 (+722%)
Mutual labels:  email-marketing, email
Mum
A web-based user management tool for Postfix and Dovecot that is easy to use and still very powerful.
Stars: ✭ 31 (-38%)
Mutual labels:  email
Cuttlefish
Transactional email server with a lovely web interface
Stars: ✭ 985 (+1870%)
Mutual labels:  email
Hm email
A HomeMatic CCU Addon for sending Emails
Stars: ✭ 30 (-40%)
Mutual labels:  email
How to get emails imap tutorial
How to get emails including there attachments and how to extract various attributes from those emails. See https://youtu.be/zFEEGkvo6O8 for a more detailed information.
Stars: ✭ 30 (-40%)
Mutual labels:  email
Anonaddy
Anonymous email forwarding
Stars: ✭ 1,022 (+1944%)
Mutual labels:  email
Emailobfuscator
Verschlüsselung von E-Mailadressen zum Schutz vor Spam
Stars: ✭ 34 (-32%)
Mutual labels:  email

MailerLite API v2 PHP SDK

It is an official PHP SDK for MailerLite API v2.

You can find more examples and information about MailerLite API v2 here: https://developers.mailerlite.com

Getting started

In order to use this library you need to have at least PHP 7.1 version.

There are two ways to use MailerLite PHP SDK:

Use Composer

If you are not familiar with Composer, learn about it here.

Then you will need to run this simple command using CLI:

composer require mailerlite/mailerlite-api-v2-php-sdk

This library is built atop of PSR-7 and PSR-18. If you are receiving Http\Discovery\Exception\DiscoveryFailedException exception, you will need to run:

composer require php-http/guzzle6-adapter
Manual (preferable for shared hostings)

This way is preferable only if you are using shared hosting and do not have a possibility to use Composer. You will need to download this archive(v0.2.3), extract it and place its contents in root folder of your project. The next step is the same as using Composer, you will need to require vendor/autoload.php file in your index.php and lets dive in!

Usage examples

Groups API

In the given example you will see how to initiate selected API and a few actions which are available:

  • Create group
  • Get groups
  • Update group
  • Get subscribers who belongs to selected group
$groupsApi = (new \MailerLiteApi\MailerLite('your-api-key'))->groups();

$newGroup = $groupsApi->create(['name' => 'New group']); // creates group and returns it

$allGroups = $groupsApi->get(); // returns array of groups

$groupId = 123;
$singleGroup = $groupsApi->find($groupId); // returns single item object

$subscribers = $groupsApi->getSubscribers($groupId); // get subscribers who belongs to selected group

$subscribers = $groupsApi->getSubscribers($groupId, 'unsubscribed'); // get unsubscribed subscribers who belongs to selected group

Use multiple APIs at once

Also `MailerLiteApi\MailerLite' object can be initiated before selecting API you want to use and it allows to achieve more.

$mailerliteClient = new \MailerLiteApi\MailerLite('your-api-key');

$groupsApi = $mailerliteClient->groups();
$groups = $groupsApi->get(); // returns array of groups

$fieldsApi = $mailerliteClient->fields();
$fields = $fieldsApi->get(); // returns array of fields

Use your preferred HTTP client

MailerLite SDK uses cURL as default HTTP client but it is easy to use your preferred client. It is achieved by using HTTPlug which is PSR-7 compliant HTTP client abstraction.

Here is an example how to use Guzzle instead of cURL:

$guzzle = new \GuzzleHttp\Client();
$guzzleClient = new \Http\Adapter\Guzzle6\Client($guzzle);

$mailerliteClient = new \MailerLiteApi\Mailerlite('your-api-key', $guzzleClient);

Support and Feedback

In case you find any bugs, submit an issue directly here in GitHub.

You are welcome to create SDK for any other programming language.

If you have any troubles using our API or SDK free to contact our support by email [email protected]

Official documentation is at https://developers.mailerlite.com

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].