BoxLang 🚀 A New JVM Dynamic Language Learn More...
A CFML wrapper for the MailerLite API.
box install cfmailerlite
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";
box install cfmailerlite
var cfmailerlite = new modules.cfmailerlite.models.cfmailerlite();
var cfmailerlite = new modules.cfmailerlite.models.cfmailerlite()
.setBaseURL( "https://api.mailerlite.com/api/v2/" )
.setAPIKey( server.system.environment.CFMAILERLITE_API_KEY );
GET /groups
- use cfmailerlite.getGroups()
GET /groups/:id
- use cfmailerlite.getGroups( id="123z" )
GET /segments
- use cfmailerlite.getSegments()
GET /subscribers
- use cfmailerlite.getSubscribers()
GET /subscribers/:id
- use cfmailerlite.getSubscribers( id="1234x" )
GET /subscribers/:email
- use cfmailerlite.getSubscribers( email="[email protected]" )
POST /groups/:id/subscribers
- use cfmailerlite.addSubscriberToGroup( id="", body={email="[email protected]"} )
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)
Copyright 2019 (and on) - Michael Born
$
box install cfmailerlite