Skip to content

dailydrip/uhura-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UhuraClient

Ruby gem for Uhura.

Installation

Include the uhura_client gem in your Gemfile:

gem 'uhura_client', git: '[email protected]/dailydrip:uhura-client.git', branch: 'master'

How to use

Export environment variables.

export UHURA_BASE_API_URL="http:https://localhost:3000/api/v1"
export UHURA_API_KEY="b33fb33fb33fb33f"
export UHURA_TEAM_ID="1"
export UHURA_PUBLIC_TOKEN="dead0beef1dead2beef3"

API

# define a message
message = UhuraClient::Message.new(
    receiver_sso_id: "99999999",
    email: UhuraClient::Email.new(
        subject: "Picnic Next Saturday",
        message: UhuraClient::EmailMessage.new(header: "Picnic Event", section1: "Next saturday is family picnic event.", section2: "Want more info?", button: "Info"),
        options: UhuraClient::EmailOptions.new(cc: "[email protected]")
    ),
    template_id: "d-05d33214e6994b01b577602036bfa9f9",
    sms_message: "Picnic Next Saturday"
)

# create a client by passing the api key, team id and public token
client = UhuraClient::MessageClient.new(
    api_key: ENV['UHURA_API_KEY'], 
    team_id: ENV['UHURA_TEAM_ID'], 
    public_token: ENV['UHURA_PUBLIC_TOKEN']
)

# send the message!
client.send_message(message)

Tests

bundle exec rspec

Releases

No releases published

Packages

No packages published

Languages