active-campaign-simple 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a2d4199c7dbf5e9d665a353d8b70497b9f4b598e56b8bd5e70aa5a4fc839417
4
- data.tar.gz: 1de93fb262ee19f2cacbd432bbb00901b28969618d14e8adc67fdb685c00b51b
3
+ metadata.gz: 863f2d3821bf796cb2d9558c4696b75754b84799a968c1bd31c3fc504c75b026
4
+ data.tar.gz: c5df73fb8d7339e12fad53324b394fe6d6f932a6d5ab59782a088deb3efb8f80
5
5
  SHA512:
6
- metadata.gz: 9a9a504fdcfb782ddb7dffd02a61e9ece8291c81091d5ff72505a0758097deb505db43fd611cec735c1a46936e4fdbddf80e452500ee4b6db92347612ac3de60
7
- data.tar.gz: 782937abd3d7e34f9864229c84fb042e70c49ec1c89630bd29bee55dd9a05dd1fc6f1f0a3d0d56f23d5848afe92bde40e5a5d7712938798dcbc1785789a1a6b8
6
+ metadata.gz: 6f39476c8204ca82f924b63167ac24696ed52d7de2954cefa49ac7726341e0589c3ed3c6b89a59ae651f23b5a2abb0079ff0c34aab589e288f42eeefb63fc8a4
7
+ data.tar.gz: 2fc8b8dbd1d4b576700b330278b30065a3022904e32f8fe5273b48661d3f4b7f9c98aabd04012c18319077df1ab18da86990da795c5f3e65d0eb5bd42c7b830b
@@ -6,16 +6,23 @@ module ActiveCampaign
6
6
  class << self
7
7
  # Post event
8
8
  def post_event(key, actid, event, email, eventdata=nil)
9
- # header = { content_type: 'application/x-www-form-urlencoded' }
9
+ headers = {
10
+ 'Content-Type': 'application/x-www-form-urlencoded',
11
+ 'Accept': 'application/json'
12
+ }
13
+
14
+ visit_data = { "email" => email }.to_json
15
+
10
16
  form = {
11
17
  key: key,
12
18
  actid: actid,
13
19
  event: event,
14
- visit: URI.encode_www_form_component("{\"email\":\"#{email}\"}")
20
+ visit: visit_data
15
21
  }
16
- form.merge!({ eventdata: eventdata }) if eventdata
17
22
 
18
- resp = RestClient.post("https://trackcmp.net/event", form)
23
+ form[:eventdata] = eventdata if eventdata
24
+
25
+ resp = RestClient.post("https://trackcmp.net/event", form, headers)
19
26
  rescue RestClient::ExceptionWithResponse => err
20
27
  ActiveCampaign::ExceptionHandler.new(err)
21
28
  else
@@ -1,4 +1,4 @@
1
1
  module ActiveCampaign
2
2
  # The version of the gem
3
- VERSION = '0.4.0'.freeze unless defined?(::ActiveCampaign::VERSION)
3
+ VERSION = '0.4.1'.freeze unless defined?(::ActiveCampaign::VERSION)
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-campaign-simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Leavitt