Coder Social home page Coder Social logo

yashodhank / tincanz Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adamakhtar/tincanz

0.0 1.0 0.0 237 KB

Segment and message users based on behavior. A simple open source intercom.io.

License: MIT License

Ruby 82.44% JavaScript 1.67% CSS 3.15% HTML 12.75%

tincanz's Introduction

#Tincanz

** Notice - I've stopped working on this project for the forseeable future. It isn't in any useable state so please look for an alternative. You may be interested in my other project github.com/robodisco/hightower which allows you to watch out for certain user behavour and automatically respond.**

# What is Tincanz

Tincanz is the better way to communicate with your users and keep them engaged. It's a very simple open source version of intercom.io.

Tincanz has two big features

  • Communicate with your users directly within your app

  • Segment your users based on predetermined behaviour and automatically send them messages when they behave like that.

## Communicate with your users

Tincanz creates a little intercom button at the bottom right of your views. When clicked your users will be presented with a message widget where they can message you and read your replies.

## Segment your users

Tincanz lets you define user behaviours. When a user behaves as defined, a predefined message can be automatically sent to them.

Possible usecases

  • Behaviour: user who has just signed up

  • Message: 'Welcome aboard…'

  • Behaviour: user who signed up but hasnt created any projects

  • Message: 'Create your first project in seconds…'

## How it Works

*Proposed usage - will probably change*

First define user behaviours in the Behaviour class

class Behaviour

define 'just signed up', message: :welcome  do |c|
  User.joined_today
end

end

Then define your message in a Messenger class

class UserMessenger

def welcome(user)
  message[:subject] = 'Welcome Aboard'
end

end

And the actual message body in its view file

#tincanz/messengers/user/welcome.txt.erb

Hi {{user.first_name}},

Welcome to the app.….

## Works great with events

To get the most out of tincanz you'll probably want some way of representing events such as

  • user created first task

  • user signed in

  • user destroyed a project

So in your tasks controller you could write

def create

...
if @task.save
  Event.create('task created')
  ...
...

end

and then in your Behaviour class you can define

class Behaviour

define 'created first task', message: :task_shortcuts_howto do
  User.include(:events).where('events.name' => 'task created').....
end

end

Tincanz doesnt include event functionality as end users will probably already have something in place. Perhaps your own custom rolled Event Model or you use a gem such as the exellent Ahoy.

**Behviour based messages** are sent only once regardless of how many times a user repeats the behaviour. This avoids the risk of spamming a user.

## Install

“`ruby gem 'tincanz' “`

“` bundle install “`

In your apps application_controller.rb

“`ruby def tincanz_user

current_user # or your own method that returns the current user

end helper_method

:tincanz_user

“`

“`ruby class User

def self.tincanz_admin
  User.where(:admin => true)
end

end “`

## Roadmap

  • Setup basic inapp messaging

  • Rollout behaviours

  • Automaticaly email message updates and allow admin and users to reply via email

tincanz's People

Contributors

adamakhtar avatar

Watchers

 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.