Giter Club home page Giter Club logo

cindy's Introduction

Cindy

A lightweight and flexible Ruby SDK for Sendy, a self-hosted email newsletter app.

Build Status Code Climate Coverage Status

Installation

Add this line to your application's Gemfile:

gem 'cindy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cindy

Usage

The API of Cindy was basically implemented after Sendy's API doc.

Client

To use Cindy, first create a client instance:

c = Cindy.new "http://sendy.co/demo/", "QywLZqDddP2P//d6ntekf+GY82nLrHke"

There're two parameters for initialize method:

  1. API Endpoint - The URL for Sendy installation.
  2. API Key - Optional, only for subscription status methods.

Subscribe / Unsubscribe

Then you can subscribe or unsubscribe from a list:

> c.subscribe 1, "[email protected]", "Foo Bar"
=> true
> c.unsubscribe 1, "[email protected]"
=> false

The parameters are:

  1. List ID - You can find them under list management page.
  2. Email - Email to subscribe or unsubscribe from the list
  3. Name - Optional, used only for subscribe

Subscription Status

To check subscription status for Email address:

> c.subscription_status 3, "[email protected]"
=> "Unsubscribed"

The parameters are list ID and Email.

Active Subscriber Count

To get active subscriber count of a list:

> c.active_subscriber_count 5
=> 1660

The only required parameter here is list ID.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

cindy's People

Contributors

dlackty avatar jonuts avatar linyiru avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.