silverfin / girlscout

Gem to interact with HelpScout.com from your Ruby application

Home Page:https://www.omise.co/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GIRLSCOUT

BETA This software is half-finished beta-quality software. Until 1.0 is released, use at your own risk!

This is a gem for talking to the HelpScout Help Desk API.

REQUIREMENTS

You will need a valid HelpScout account setup for the API key in order to use this gem. This gem has been developed and tested on Ruby 2.2.3p173

INSTALLATION

Using bundler:

gem 'girlscout'

Or manually via rubygems:

$ gem install girlscout

USAGE

Configuration

Before starting out, obtain your HelpScout API Key from the HelpScout dashboard and configure your api_key in the application:

require 'girlscout'

GirlScout::Config.api_key = 'put your helpscout API key here'

Accesses

GirlScout provides AR-style accessor methods on model classes, use them to retrieve data from HelpScout:

mailboxes = GirlScout::Mailbox.all
puts mailboxes.first.name
# => "Support"

conversation = GirlScout::Conversation.find(12345)
puts conversation.id
# => 12345

To create a new conversation, build the models and use the create method on the model class:

user = GirlScout::User.me
mailbox = GirlScout::Mailbox.new(id: 123)
customer = GirlScout::Customer.new(email: "customer@example.com")

thread = GirlScout::Thread.new({
  type: "message",
  created_by: user,
  body: "You may reply to this email directly for support!"
})

conversation = GirlScout::Conversation.new(
  type: :email,
  subject: "Thanks for registering at Awesome SaaS company XYZ!",
  mailbox: mailbox,
  customer: customer,
  threads: [thread]
)

conversation = GirlScout::Conversation.create(conversation)

LICENSE

MIT

About

Gem to interact with HelpScout.com from your Ruby application

https://www.omise.co/

License:MIT License


Languages

Language:Ruby 100.0%