Project

ruby-swift

0.0
No commit activity in last 3 years
No release in over 3 years
A ruby wrapper of the Swift Digital Suite Mail House API (https://suite.swiftdigital.com.au).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

RubySwift

A ruby wrapper of the Swift Digital Suite Mail House API.

This is currently a relatively crude wrapper and does not tidy responses from Swift a lot. Contributions are welcome.

Version 1.0.0 introduced breaking changes on the way the wrapper returns responses.

INSTALLATION

You can install the library via Rubygems:

$ gem install ruby-swift

Or within your Gemfile if you're using Bundler:

gem "ruby-swift"

USAGE

Initialize the connection:

swift = RubySwift.new("API_PASSWORD")

Helpers:

swift.person_exists?("you@example.com") # -> true

API methods:

Read a person:

person = swift.read_person("you@example.com") # -> {:status => 0, :response => {...}}

Add someone to a mail group:

swift.add_group_member("you@example.com", "Group Name") # -> {:status => 0, :response => true}

Remove someone from a mail group:

swift.remove_group_member("you@example.com", "Group Name") # -> {:status => 0, :response => true} 

Create a person:

swift.write_person(email: "me@example.com", first_name: "Dennis", last_name: "Ritchie") # -> {:status => 0, :response => true}

Update person:

swift.update_person(email: "you@example.com", first_name: "Donald", last_name: "Knuth") # -> {:status => 0, :response => true}

Create or update existing person:

swift.write_or_update_person(email: "me@example.com", first_name: "Dennis", last_name: "Ritchie") # -> {:status => 0, :response => true}

Create a group:

swift.write_group("Group name") # -> {:status => 0, :response => true}

Read all groups:

groups = swift.read_groups # -> {:status => 0, :response => ["group1", "group2", ...]}

Read all members of a group:

people = swift.read_persons("Group Name") # -> {:status => 0, :response => [{...}, ...]}

Remove a group:

swift.remove_group("Group Name") # -> {:status => 0, :response => true}

Remove a person:

swift.remove_person("you@example.com") # -> {:status => 0, :response => true}

TODO

  • Allow custom fields in write/update