Giter VIP home page Giter VIP logo

minitel's Introduction

𝕄𝕀ℕ𝕀𝕋𝔼𝕃

A 𝕋𝔼𝕃𝔼𝕏 client

Gem Version Build Status

Producer Credentials

Get credentials to use by following the instructions here: https://github.com/heroku/engineering-docs/blob/master/components/telex/user-guide.md

Installing Minitel

You'll need to add our private gemserver first, see here: https://gemgate-heroku-internal-gems.herokuapp.com/setup-instructions

Quick Setup

This will help you send a notification to just yourself, as a sanity check that everything is set up properly

Before you do this:

  • Get your producer credentials (above)
  • get minitel (above) and dotenv installed locally
  • Grab your user account id, for example by doing: heroku api get /account | jq '.id' -r
# .env
TELEX_URL = 'https://user:[email protected]'
MY_USER_ID = '123'
# minitel-testing.rb or irb
require 'dotenv/load'
require 'minitel'

client = Minitel::Client.new(ENV['TELEX_URL'])

message = client.notify_user(user_uuid: ENV['MY_USER_ID'], title: 'Test Notification', body: 'Test Notification Body.')
puts "message " + message['id'] + " sent"

Once you run this, you should receive both:

  • receive an email (eventually, depending on the backlog)
  • see this in Dashboard's Notification Center

Usage Examples

require 'minitel'
# create a client
client = Minitel::Client.new("https://user:[email protected]")

# send a notification to the owner and collaborators of an app
client.notify_app(app_uuid: '...', title: 'Your database is on fire!', body: 'Sorry.')
# => {"id"=>"uuid of message"}

# send a notification to a user
client.notify_user(user_uuid: '...', title: 'Here is your invoice', body: 'You owe us 65k.')
# => {"id"=>"uuid of message"}

# send a notification with an email action
# see: https://developers.google.com/gmail/markup/reference/go-to-action
client.notify_user(user_uuid: '...',
  title: 'Here is your invoice',
  body: 'You owe us 65k.',
  action: { label: 'View Invoice', url: 'https://heroku.com/invoices/12345-12-98765'})

# add follow-up to a previous notification
client.add_followup(message_uuid: '...', body: 'here are even more details')

minitel's People

Contributors

beanieboi avatar caseywatts avatar halorgium avatar jsullivan avatar svc-scm avatar will avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kleopatra999

minitel's Issues

bad error message when `nil` passed into the url

it should be more explicit

    undefined method `start_with?' for nil:NilClass
        @ /Users/will/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/minitel-0.2.0/lib/minitel/client.rb:9:in `initialize'

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.