BoxLang 🚀 A New JVM Dynamic Language Learn More...

cfMailerLite

v0.1.1 Modules

cfMailerLite

A CFML wrapper for the MailerLite API.

Getting Started: ColdBox Setup

  1. Install this module: box install cfmailerlite
  2. Obtain an API key from MailerLite.
  3. Place the API key in your config/Coldbox.cfc like so:
moduleSettings = {
	cfmailerlite: {
		apiKey: server.system.environment.CFMAILERLITE_API_KEY
	}
};

Then inject cfmailerlite to use the API:

property name="cfmailerlite" inject="cfmailerlite@cfmailerlite";

Getting Started: Vanilla CFML Setup

  1. Install this module: box install cfmailerlite
  2. Obtain an API key from MailerLite.
  3. Instantiate the model:
var cfmailerlite = new modules.cfmailerlite.models.cfmailerlite();
  1. Set the API key and base API url:
var cfmailerlite = new modules.cfmailerlite.models.cfmailerlite()
	.setBaseURL( "https://api.mailerlite.com/api/v2/" )
	.setAPIKey( server.system.environment.CFMAILERLITE_API_KEY );

Supported API Endpoints

Subscriber Groups

  • GET /groups - use cfmailerlite.getGroups()
  • GET /groups/:id - use cfmailerlite.getGroups( id="123z" )

Segments

  • GET /segments - use cfmailerlite.getSegments()

Subscribers

  • GET /subscribers - use cfmailerlite.getSubscribers()
  • GET /subscribers/:id - use cfmailerlite.getSubscribers( id="1234x" )
  • GET /subscribers/:email - use cfmailerlite.getSubscribers( email="[email protected]" )

Adding Subscribers to a Group

  • POST /groups/:id/subscribers - use cfmailerlite.addSubscriberToGroup( id="", body={email="[email protected]"} )

TODO

  • ❌ Finish writing tests
  • ❌ Add full API support

The Good News

For all have sinned, and come short of the glory of God (Romans 3:23)

But God commendeth his love toward us, in that, while we were yet sinners, Christ died for us. (Romans 5:8)

That if thou shalt confess with thy mouth the Lord Jesus, and shalt believe in thine heart that God hath raised him from the dead, thou shalt be saved. (Romans 10:9)

Repository

Copyright 2019 (and on) - Michael Born

cfmlbadges cfmlbadges cfmlbadges cfmlbadges

$ box install cfmailerlite

No collaborators yet.
 
  • {{ getFullDate("2019-10-05T16:43:50Z") }}
  • {{ getFullDate("2019-10-05T17:16:18Z") }}
  • 1,725
  • 2,101