active-campaign-simple 0.3.5 → 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: fc27404973c86243ac6c81d646ca1dbbac9617aa8f667b42c967bc412df6d702
4
- data.tar.gz: 32978be84621b63b9adce82db307a844f71dfdcb2dfceb3588cf9cb7e286a318
3
+ metadata.gz: 863f2d3821bf796cb2d9558c4696b75754b84799a968c1bd31c3fc504c75b026
4
+ data.tar.gz: c5df73fb8d7339e12fad53324b394fe6d6f932a6d5ab59782a088deb3efb8f80
5
5
  SHA512:
6
- metadata.gz: f333f0d8d0ec35ab26e61ad0f427edcd6ead13355490386d477494b3b23fe1fcadaebd24cd22b265cb95eb1ab31cf8e9e9463e8ec832c2efc01dd5206c99be08
7
- data.tar.gz: fd064d310b1619afc8897fa21b8b02dfa51cb09aa041bfd31d257f37645ced416003cb0eb59d559d6ee7ab5e3e92de1c902a55baa70fe6fc0a333b20c358cad4
6
+ metadata.gz: 6f39476c8204ca82f924b63167ac24696ed52d7de2954cefa49ac7726341e0589c3ed3c6b89a59ae651f23b5a2abb0079ff0c34aab589e288f42eeefb63fc8a4
7
+ data.tar.gz: 2fc8b8dbd1d4b576700b330278b30065a3022904e32f8fe5273b48661d3f4b7f9c98aabd04012c18319077df1ab18da86990da795c5f3e65d0eb5bd42c7b830b
@@ -6,17 +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 })
15
- # visit: { email: email }
20
+ visit: visit_data
16
21
  }
17
- form.merge!({ eventdata: eventdata }) if eventdata
18
22
 
19
- 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)
20
26
  rescue RestClient::ExceptionWithResponse => err
21
27
  ActiveCampaign::ExceptionHandler.new(err)
22
28
  else
@@ -1,4 +1,4 @@
1
1
  module ActiveCampaign
2
2
  # The version of the gem
3
- VERSION = '0.3.5'.freeze unless defined?(::ActiveCampaign::VERSION)
3
+ VERSION = '0.4.1'.freeze unless defined?(::ActiveCampaign::VERSION)
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-campaign-simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Leavitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-13 00:00:00.000000000 Z
11
+ date: 2024-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  - !ruby/object:Gem::Version
79
79
  version: 3.0.0
80
80
  requirements: []
81
- rubygems_version: 3.3.26
81
+ rubygems_version: 3.5.6
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: Simple Ruby REST wrapper for the ActiveCampaign API