smartlist_push_api 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b47169a3ba69b2c338c2335ce397cd492f13525
4
- data.tar.gz: 6b5595ebf954eac27764859406190fd3b0228185
3
+ metadata.gz: 900307f864a94662a451fc2d955f5d960e445e08
4
+ data.tar.gz: fb6d0bfb97741264d7546c0d5a370a3309cb10fb
5
5
  SHA512:
6
- metadata.gz: 4403e960567adde50c633cc8bde86356521f0bd1126adf3401ba04da4a6e428b1b1efca7d46dda58beed9bf7b43c05f04754a0555470933b2499d5de8e7cfbab
7
- data.tar.gz: 8946649e944635b593eff11e99e90df050e7e3318c7cd6e8e6737873429ede66f5b15cf3a65cda1ad60dc2fad07e9f631d6104b9670faae9f4cc8fe0fc82ccb5
6
+ metadata.gz: b205a40358aaf65225a5c61c16ff9b017110d03a211db586d5622d094f6081905fd498864724edf515a07171b7eefcaaf64dc8007078992c34f045cbf8ed9912
7
+ data.tar.gz: 8d61e6fb250020ea3cb5eb65f56f5285796d015fce6d3f5877476f9c3b9a8d2d36bf09a7ffc4444b1bbef55d8e0138b2998f690c313bc66a49f34f599338629d
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Smartlist Push API
2
2
 
3
- THe Smartlist Push API allows you to send your user activity to Smartlist to drive analytics and automated messaging through the Smartlist application. The data that you send to Smartlist is used to set up filters that enable the creation of segments and targeting for automated messaging to users.
3
+ The Smartlist Push API allows you to send your user activity to Smartlist to drive analytics and automated messaging through the Smartlist application. The data that you send to Smartlist is used to set up filters that enable the creation of segments and targeting for automated messaging to users.
4
4
 
5
5
  ## Installation
6
6
 
@@ -53,6 +53,8 @@ Once a user registers within your app, you can send that information to Smartlis
53
53
 
54
54
  The field `ref_id` is required and should be unique for each user from your app. You will use that field to create or update a user’s information.
55
55
 
56
+ You can also use the above method to deliver your existing users data to Smartlist.
57
+
56
58
  When a user changes their data, you can sync information with Smartlist with the following method:
57
59
 
58
60
  ```ruby
@@ -76,6 +78,7 @@ Every time user logs in in your app, you can update Smartlist (as a way to track
76
78
  ```
77
79
  This method receive two attributes: user's `ref_id` and a `datetime` object.
78
80
 
81
+ You can also use the above method to deliver your existing users login activity to Smartlist.
79
82
 
80
83
  #### Subscription Activity
81
84
 
@@ -96,7 +99,21 @@ If your app has subscription plans, you can send that to Smartlist to filter use
96
99
  # ref_id, plan name that was canceled, datetime object when subscription was cancelled
97
100
  SmartlistPushApi::User.canceled_subscription('ref_user_102', 'Pro', 2.days.ago)
98
101
  ```
102
+ You can also use the above method to deliver your existing users subscription status to Smartlist.
103
+
104
+ #### Custom Events
105
+
106
+ For all other events that you have inside your app, you can use following method to post them to Smartlist.
107
+
108
+ ```rails
109
+ SmartlistPushApi::Custom.create('ref_user_102', {
110
+ event: 'rented-movie',
111
+ title: 'The Man Who Knew Infinity',
112
+ event_date: '2016-07-26 20:28:37',
113
+ payload: ['drama', 'biography']
114
+ })
115
+ ```
99
116
 
100
117
  ## License
101
118
 
102
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
119
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -1,6 +1,7 @@
1
1
  require 'smartlist_push_api/version'
2
2
  require 'smartlist_push_api/http/http_client'
3
3
  require 'smartlist_push_api/user'
4
+ require 'smartlist_push_api/custom'
4
5
 
5
6
  module SmartlistPushApi
6
7
  class InvalidDataException < StandardError;
@@ -0,0 +1,9 @@
1
+ module SmartlistPushApi
2
+ class Custom
3
+
4
+ def self.create(user_id, data)
5
+ SmartlistPushApi.make_post_request('/custom/', {id: user_id}.merge(data))
6
+ end
7
+
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module SmartlistPushApi
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartlist_push_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Bajalovic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-10 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -98,6 +98,7 @@ files:
98
98
  - bin/console
99
99
  - bin/setup
100
100
  - lib/smartlist_push_api.rb
101
+ - lib/smartlist_push_api/custom.rb
101
102
  - lib/smartlist_push_api/http/http_client.rb
102
103
  - lib/smartlist_push_api/user.rb
103
104
  - lib/smartlist_push_api/version.rb