FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

cfMailerLite

v0.1.1 Public

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="[email protected]";

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

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Actions
Current
0.1.1 Oct 05 2019 05:16 PM Oct 05 2019 05:16 PM
Version History
0.1.0 Oct 05 2019 04:43 PM Oct 05 2019 04:43 PM

 

No collaborators yet.
 
  • Oct 05 2019 04:43 PM
  • Oct 05 2019 05:16 PM
  • 42
  • 34
  • 22