mautic 2.4.0 → 3.0.0
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 +4 -4
- data/README.md +15 -3
- data/app/models/mautic/company_field.rb +11 -0
- data/app/models/mautic/connection.rb +1 -1
- data/app/models/mautic/connections/oauth2.rb +2 -0
- data/app/models/mautic/contact.rb +42 -1
- data/app/models/mautic/contact_field.rb +11 -0
- data/app/models/mautic/form.rb +30 -1
- data/app/models/mautic/stage.rb +22 -0
- data/app/models/mautic/web_hook.rb +1 -1
- data/app/views/layouts/mautic/application.html.erb +0 -2
- data/db/migrate/20171028082047_create_mautic_mautic_connections.rb +5 -3
- data/lib/mautic/model.rb +22 -13
- data/lib/mautic/proxy.rb +2 -2
- data/lib/mautic/submissions/form.rb +16 -0
- data/lib/mautic/version.rb +1 -1
- data/lib/mautic.rb +24 -23
- metadata +46 -35
- data/app/assets/config/mautic_manifest.js +0 -2
- data/app/assets/javascripts/mautic/application.js +0 -14
- data/app/assets/javascripts/mautic/mautic_connections.js +0 -2
- data/app/assets/stylesheets/mautic/application.css +0 -15
- data/app/assets/stylesheets/mautic/mautic_connections.css +0 -4
- data/app/assets/stylesheets/scaffold.css +0 -80
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcc9d407cc133d52f797f177e0b7c3f2d605a88250a4fd821d3c98c215b4971f
|
4
|
+
data.tar.gz: dfdebe03cc788179e1a50e29d06f0c0a355c0e97135815af608727c5a9779e70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1074c4f45a5e034a8ad84e4f1ffe787093b8d65a771b89fa493debc4d1ede4f89cc19c88cdbadf85dd1d769ff320bf9c07d5d8772205d9f914740cb1e370d349
|
7
|
+
data.tar.gz: 731a48b00dd6bb42fe908c97fdbf14b0a8887b63858634e763e051570a16fab660bacc41a1f9f8515ad1557ab09768fc2c22ac2dd764d6269fceec1fd033e348
|
data/README.md
CHANGED
@@ -94,11 +94,11 @@ end
|
|
94
94
|
```
|
95
95
|
Get specify contact:
|
96
96
|
```ruby
|
97
|
-
contact = m.contact.find(1) # =>
|
97
|
+
contact = m.contact.find(1) # => #<Mautic::Contact id=1 ...>
|
98
98
|
```
|
99
99
|
Collections of contacts:
|
100
100
|
```ruby
|
101
|
-
m.contacts.where("gmail").each do |contact|
|
101
|
+
m.contacts.where(search: "gmail").each do |contact|
|
102
102
|
#<Mautic::Contact id=12 ...>
|
103
103
|
#<Mautic::Contact id=21 ...>
|
104
104
|
#<Mautic::Contact id=99 ...>
|
@@ -115,7 +115,7 @@ end
|
|
115
115
|
contact.save # => false
|
116
116
|
contact.errors # => [{"code"=>400, "message"=>"email: This field is required.", "details"=>{"email"=>["This field is required."]}}]
|
117
117
|
```
|
118
|
-
Do not contact
|
118
|
+
#### Do not contact
|
119
119
|
```ruby
|
120
120
|
contact.do_not_contact? # => false
|
121
121
|
contact.do_not_contact! message: "Some reason"
|
@@ -127,6 +127,18 @@ end
|
|
127
127
|
contact.remove_do_not_contact!
|
128
128
|
contact.do_not_contact? # => false
|
129
129
|
```
|
130
|
+
#### Campaigns
|
131
|
+
list of contacts campaigns (where contact is a member) and remove it from one
|
132
|
+
```ruby
|
133
|
+
contact.campaigns #=> [Mautic::Campaign, ...]
|
134
|
+
campaign = contact.campaigns.find { |campaign| campaign.name == "Newsletter" }
|
135
|
+
campaign.remove_contact! contact.id
|
136
|
+
```
|
137
|
+
or add contact back
|
138
|
+
```ruby
|
139
|
+
campaign = connection.campaigns.where(search: "Newsletter").first
|
140
|
+
campaign.add_contact! contact.id
|
141
|
+
```
|
130
142
|
Of course you can use more than contact: `assets`, `emails`, `companies`, `forms`, `points` ...
|
131
143
|
### Gem provides simple Mautic form submit
|
132
144
|
There are two options of usage:
|
@@ -27,6 +27,8 @@ module Mautic
|
|
27
27
|
@connection = connection.refresh!
|
28
28
|
update(token: @connection.token, refresh_token: @connection.refresh_token)
|
29
29
|
@connection
|
30
|
+
rescue StandardError
|
31
|
+
raise ::Mautic::TokenExpiredError, "your refresh_token is probably expired - re-authorize your connection"
|
30
32
|
end
|
31
33
|
|
32
34
|
def request(type, path, params = {})
|
@@ -1,6 +1,9 @@
|
|
1
1
|
module Mautic
|
2
2
|
class Contact < Model
|
3
3
|
|
4
|
+
around_create :ensure_stage, if: ->(contact) { contact.changes.has_key?(:stage_id) }
|
5
|
+
around_update :ensure_stage, if: ->(contact) { contact.changes.has_key?(:stage_id) }
|
6
|
+
|
4
7
|
alias_attribute :first_name, :firstname
|
5
8
|
alias_attribute :last_name, :lastname
|
6
9
|
|
@@ -41,11 +44,13 @@ module Mautic
|
|
41
44
|
|
42
45
|
if source
|
43
46
|
self.owner = source['owner'] || {}
|
47
|
+
self.stage = source['stage'] || {}
|
44
48
|
tags = (source['tags'] || []).map { |t| Mautic::Tag.new(self, t) }.sort_by(&:name)
|
45
49
|
self.attributes = {
|
46
50
|
tags: Tag::Collection.new(self, *tags),
|
47
51
|
doNotContact: source['doNotContact'] || [],
|
48
52
|
owner: owner['id'],
|
53
|
+
stage_id: stage&.id,
|
49
54
|
}
|
50
55
|
end
|
51
56
|
end
|
@@ -134,11 +139,47 @@ module Mautic
|
|
134
139
|
|
135
140
|
# !endgroup
|
136
141
|
|
142
|
+
# @!group Stage
|
143
|
+
|
144
|
+
# @return [Mautic::Stage, nil]
|
145
|
+
def stage
|
146
|
+
@stage
|
147
|
+
end
|
148
|
+
|
149
|
+
# @param [Mautic:::Stage,Hash, nil] hash
|
150
|
+
def stage=(object_or_hash)
|
151
|
+
@stage = case object_or_hash
|
152
|
+
when Mautic::Stage
|
153
|
+
object_or_hash
|
154
|
+
when Hash
|
155
|
+
Mautic::Stage.new(connection, object_or_hash)
|
156
|
+
end
|
157
|
+
@table[:stage_id] = @stage&.id
|
158
|
+
@stage
|
159
|
+
end
|
160
|
+
|
161
|
+
# !endgroup
|
162
|
+
|
137
163
|
private
|
138
164
|
|
139
165
|
def clear_change
|
140
166
|
super
|
141
167
|
remove_instance_variable :@do_not_contact
|
142
168
|
end
|
169
|
+
|
170
|
+
# Add or Remove contact in stage after contact save
|
171
|
+
def ensure_stage
|
172
|
+
stage_id_change = changes[:stage_id]
|
173
|
+
yield
|
174
|
+
if stage_id_change
|
175
|
+
self.stage = Mautic::Stage.in(connection).find(stage_id_change)
|
176
|
+
stage.add_contact!(id)
|
177
|
+
@table[:stage_id] = stage.id
|
178
|
+
else
|
179
|
+
stage.remove_contact!(id)
|
180
|
+
@table.delete(:stage_id)
|
181
|
+
end
|
182
|
+
clear_changes
|
183
|
+
end
|
143
184
|
end
|
144
|
-
end
|
185
|
+
end
|
data/app/models/mautic/form.rb
CHANGED
@@ -5,5 +5,34 @@ module Mautic
|
|
5
5
|
self.attributes = { name: source['name'], fields: source['fields'] } if source.is_a? Hash
|
6
6
|
end
|
7
7
|
|
8
|
+
# @param [Integer] submission_id
|
9
|
+
# @return Mautic::Submissions::Form
|
10
|
+
# @see https://developer.mautic.org/#get-form-submission
|
11
|
+
def submission(submission_id)
|
12
|
+
json = @connection.request(:get, "api/forms/#{id}/submissions/#{submission_id}")
|
13
|
+
Mautic::Submissions::Form.new @connection, json["submission"]
|
14
|
+
rescue Mautic::RecordNotFound => _e
|
15
|
+
nil
|
16
|
+
end
|
17
|
+
|
18
|
+
# @see https://developer.mautic.org/#list-form-submissions
|
19
|
+
# @param [Hash] options
|
20
|
+
# @option options [String] :search String or search command to filter entities by.
|
21
|
+
# @option options [String] :start Starting row for the entities returned. Defaults to 0.
|
22
|
+
# @option options [String] :limit Limit number of entities to return. Defaults to the system configuration for pagination (30).
|
23
|
+
# @option options [String] :orderBy Column to sort by. Can use any column listed in the response, also can use column of joined table with prefix. Sort by submitted date is s.date_submitted
|
24
|
+
# @option options [String] :orderByDir Sort direction: asc or desc.
|
25
|
+
# @option options [String] :publishedOnly Only return currently published entities.
|
26
|
+
# @option options [String] :minimal Return only array of entities without additional lists in it.
|
27
|
+
# @return Array[Mautic::Submissions::Form]
|
28
|
+
def submissions(**options)
|
29
|
+
json = @connection.request(:get, "api/forms/#{id}/submissions", params: options)
|
30
|
+
@submissions = json["submissions"].collect do |attributes|
|
31
|
+
Mautic::Submissions::Form.new @connection, attributes
|
32
|
+
end
|
33
|
+
rescue RequestError => _e
|
34
|
+
[]
|
35
|
+
end
|
36
|
+
|
8
37
|
end
|
9
|
-
end
|
38
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Mautic
|
2
|
+
class Stage < Model
|
3
|
+
|
4
|
+
# @see https://developer.mautic.org/#add-contact-to-a-stage
|
5
|
+
# @param [Integer] id of Mautic::Contact
|
6
|
+
def add_contact!(id)
|
7
|
+
json = @connection.request(:post, "api/stages/#{self.id}/contact/#{id}/add")
|
8
|
+
json["success"]
|
9
|
+
rescue RequestError => _e
|
10
|
+
false
|
11
|
+
end
|
12
|
+
|
13
|
+
# @see https://developer.mautic.org/#remove-contact-from-a-stage
|
14
|
+
# @param [Integer] id of Mautic::Contact
|
15
|
+
def remove_contact!(id)
|
16
|
+
json = @connection.request(:post, "api/stages/#{self.id}/contact/#{id}/remove")
|
17
|
+
json["success"]
|
18
|
+
rescue RequestError => _e
|
19
|
+
false
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -12,7 +12,7 @@ module Mautic
|
|
12
12
|
|
13
13
|
def form_submissions
|
14
14
|
@forms ||= Array.wrap(@params.require("mautic.form_on_submit")).collect do |data|
|
15
|
-
p = data.permit(submission: [:id, :referer, form: {}, lead: {}, results: {}]).to_h
|
15
|
+
p = data.permit(submission: [:id, :referer, form: {}, lead: {}, results: {}, ipAddress: {}]).to_h
|
16
16
|
::Mautic::Submissions::Form.new(@connection, p["submission"]) if p["submission"]
|
17
17
|
end.compact
|
18
18
|
end
|
@@ -1,4 +1,5 @@
|
|
1
|
-
class CreateMauticMauticConnections <
|
1
|
+
class CreateMauticMauticConnections < ActiveRecord::Migration[6.0]
|
2
|
+
|
2
3
|
def change
|
3
4
|
create_table :mautic_connections do |t|
|
4
5
|
t.string :type
|
@@ -10,7 +11,8 @@ class CreateMauticMauticConnections < Mautic::DummyMigrationClass
|
|
10
11
|
t.string :token
|
11
12
|
t.string :refresh_token
|
12
13
|
|
13
|
-
t.timestamps
|
14
|
+
t.timestamps
|
14
15
|
end
|
15
16
|
end
|
16
|
-
|
17
|
+
|
18
|
+
end
|
data/lib/mautic/model.rb
CHANGED
@@ -2,6 +2,7 @@ module Mautic
|
|
2
2
|
# Virtual model for Mautic endpoint
|
3
3
|
# @see https://developer.mautic.org/#endpoints
|
4
4
|
class Model < OpenStruct
|
5
|
+
extend ActiveModel::Callbacks
|
5
6
|
|
6
7
|
class MauticHash < Hash
|
7
8
|
|
@@ -37,6 +38,8 @@ module Mautic
|
|
37
38
|
|
38
39
|
end
|
39
40
|
|
41
|
+
define_model_callbacks :create, :update, :save
|
42
|
+
|
40
43
|
attr_reader :connection
|
41
44
|
attr_accessor :errors
|
42
45
|
attr_writer :changed
|
@@ -55,15 +58,19 @@ module Mautic
|
|
55
58
|
end
|
56
59
|
|
57
60
|
def save(force = false)
|
58
|
-
|
61
|
+
run_callbacks :save do
|
62
|
+
id.present? ? update(force) : create
|
63
|
+
end
|
59
64
|
end
|
60
65
|
|
61
66
|
def update(force = false)
|
62
67
|
return false unless changed?
|
63
68
|
|
64
69
|
begin
|
65
|
-
|
66
|
-
|
70
|
+
run_callbacks :create do
|
71
|
+
json = @connection.request((force && :put || :patch), "api/#{endpoint}/#{id}/edit", body: to_mautic)
|
72
|
+
assign_attributes json[endpoint.singularize]
|
73
|
+
end
|
67
74
|
clear_changes
|
68
75
|
rescue ValidationError => e
|
69
76
|
self.errors = e.errors
|
@@ -82,8 +89,10 @@ module Mautic
|
|
82
89
|
|
83
90
|
def create
|
84
91
|
begin
|
85
|
-
|
86
|
-
|
92
|
+
run_callbacks :create do
|
93
|
+
json = @connection.request(:post, "api/#{endpoint}/#{id && "#{id}/"}new", body: to_mautic)
|
94
|
+
assign_attributes json[endpoint.singularize]
|
95
|
+
end
|
87
96
|
clear_changes
|
88
97
|
rescue ValidationError => e
|
89
98
|
self.errors = e.errors
|
@@ -124,14 +133,14 @@ module Mautic
|
|
124
133
|
end
|
125
134
|
|
126
135
|
def to_mautic(data = @table)
|
127
|
-
data.
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
136
|
+
data.transform_values do |val|
|
137
|
+
if val.respond_to?(:to_mautic)
|
138
|
+
val.to_mautic
|
139
|
+
elsif val.is_a?(Array)
|
140
|
+
val.join("|")
|
141
|
+
else
|
142
|
+
val
|
143
|
+
end
|
135
144
|
end
|
136
145
|
end
|
137
146
|
|
data/lib/mautic/proxy.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module Mautic
|
2
2
|
module Submissions
|
3
|
+
# @see https://developer.mautic.org/#get-form-submissions
|
3
4
|
class Form
|
4
5
|
attr_reader :id
|
5
6
|
|
@@ -31,11 +32,26 @@ module Mautic
|
|
31
32
|
@contact ||= @connection.contacts.new(@raw["lead"])
|
32
33
|
end
|
33
34
|
|
35
|
+
# @return [Hash]
|
36
|
+
def ip_details
|
37
|
+
ip_address["ipDetails"] || {}
|
38
|
+
end
|
39
|
+
|
40
|
+
# @return [Hash]
|
41
|
+
def ip_address
|
42
|
+
@raw["ipAddress"] || {}
|
43
|
+
end
|
44
|
+
|
34
45
|
# @return [String]
|
35
46
|
def referer
|
36
47
|
@raw["referer"].to_s
|
37
48
|
end
|
38
49
|
|
50
|
+
# @return [Hash]
|
51
|
+
def results
|
52
|
+
@raw["results"]
|
53
|
+
end
|
54
|
+
|
39
55
|
end
|
40
56
|
end
|
41
57
|
end
|
data/lib/mautic/version.rb
CHANGED
data/lib/mautic.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "oauth2"
|
2
|
+
require "ostruct"
|
2
3
|
require "mautic/engine"
|
3
4
|
|
4
5
|
module Mautic
|
@@ -17,31 +18,39 @@ module Mautic
|
|
17
18
|
@errors ||= []
|
18
19
|
@response = response
|
19
20
|
@request_url = response.response&.env&.url
|
21
|
+
unless message
|
22
|
+
json_body = parse_response(response)
|
23
|
+
message = Array(json_body['errors']).collect do |error|
|
24
|
+
msg = error['code'].to_s
|
25
|
+
msg << " (#{error['type']}):" if error['type']
|
26
|
+
msg << " #{error['message']}"
|
27
|
+
@errors << error['message']
|
28
|
+
msg
|
29
|
+
end.join(', ')
|
30
|
+
end
|
31
|
+
|
32
|
+
super("#{@request_url} => #{message}")
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def parse_response(response)
|
20
38
|
body = if response.body.start_with? "<!DOCTYPE html>"
|
21
39
|
response.body.split("\n").last
|
22
40
|
else
|
23
41
|
response.body
|
24
42
|
end
|
25
43
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
message ||= Array(json_body['errors']).collect do |error|
|
32
|
-
msg = error['code'].to_s
|
33
|
-
msg << " (#{error['type']}):" if error['type']
|
34
|
-
msg << " #{error['message']}"
|
35
|
-
@errors << error['message']
|
36
|
-
msg
|
37
|
-
end.join(', ')
|
38
|
-
|
39
|
-
super("#{@request_url} => #{message}")
|
44
|
+
begin
|
45
|
+
JSON.parse(body)
|
46
|
+
rescue JSON::ParserError
|
47
|
+
{ "errors" => [{ "code" => response.status, "message" => body }] }
|
48
|
+
end
|
40
49
|
end
|
41
50
|
|
42
51
|
end
|
43
52
|
|
44
|
-
class TokenExpiredError <
|
53
|
+
class TokenExpiredError < StandardError
|
45
54
|
end
|
46
55
|
|
47
56
|
class ValidationError < RequestError
|
@@ -78,12 +87,4 @@ module Mautic
|
|
78
87
|
end
|
79
88
|
# Your code goes here...
|
80
89
|
|
81
|
-
if Rails.version.start_with? "4"
|
82
|
-
class DummyMigrationClass < ActiveRecord::Migration
|
83
|
-
end
|
84
|
-
else
|
85
|
-
class DummyMigrationClass < ActiveRecord::Migration[4.2]
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
90
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mautic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukáš Pokorný
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,28 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 6.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 6.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: oauth2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.4.9
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.4.9
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ostruct
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.5.3
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.5.3
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rest-client
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,103 +67,103 @@ dependencies:
|
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '2.0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: database_cleaner
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
75
|
+
version: '1.7'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1.
|
82
|
+
version: '1.7'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
84
|
+
name: factory_bot_rails
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
89
|
+
version: '5.1'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
96
|
+
version: '5.1'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: faker
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
103
|
+
version: '2.7'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
110
|
+
version: '2.7'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
112
|
+
name: pry-rails
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
117
|
+
version: '0.3'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
124
|
+
version: '0.3'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
126
|
+
name: rspec-rails
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
131
|
+
version: '5.1'
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
138
|
+
version: '5.1'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
140
|
+
name: sqlite3
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
143
|
- - "~>"
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
145
|
+
version: '1.4'
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
152
|
+
version: '1.4'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
154
|
+
name: webmock
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
157
|
- - "~>"
|
144
158
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
159
|
+
version: '3.7'
|
146
160
|
type: :development
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
164
|
- - "~>"
|
151
165
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
166
|
+
version: '3.7'
|
153
167
|
description: Rails client for Mautic API. Provide wrapper for push to mautic form
|
154
168
|
email:
|
155
169
|
- pokorny@luk4s.cz
|
@@ -160,12 +174,6 @@ files:
|
|
160
174
|
- MIT-LICENSE
|
161
175
|
- README.md
|
162
176
|
- Rakefile
|
163
|
-
- app/assets/config/mautic_manifest.js
|
164
|
-
- app/assets/javascripts/mautic/application.js
|
165
|
-
- app/assets/javascripts/mautic/mautic_connections.js
|
166
|
-
- app/assets/stylesheets/mautic/application.css
|
167
|
-
- app/assets/stylesheets/mautic/mautic_connections.css
|
168
|
-
- app/assets/stylesheets/scaffold.css
|
169
177
|
- app/controllers/concerns/mautic/connections_controller_concern.rb
|
170
178
|
- app/controllers/concerns/mautic/receive_web_hooks.rb
|
171
179
|
- app/controllers/mautic/application_controller.rb
|
@@ -175,11 +183,14 @@ files:
|
|
175
183
|
- app/mailers/mautic/application_mailer.rb
|
176
184
|
- app/models/mautic/application_record.rb
|
177
185
|
- app/models/mautic/campaign.rb
|
186
|
+
- app/models/mautic/company_field.rb
|
178
187
|
- app/models/mautic/connection.rb
|
179
188
|
- app/models/mautic/connections/oauth2.rb
|
180
189
|
- app/models/mautic/contact.rb
|
190
|
+
- app/models/mautic/contact_field.rb
|
181
191
|
- app/models/mautic/event.rb
|
182
192
|
- app/models/mautic/form.rb
|
193
|
+
- app/models/mautic/stage.rb
|
183
194
|
- app/models/mautic/tag.rb
|
184
195
|
- app/models/mautic/web_hook.rb
|
185
196
|
- app/views/layouts/mautic/application.html.erb
|
@@ -216,14 +227,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
216
227
|
requirements:
|
217
228
|
- - ">="
|
218
229
|
- !ruby/object:Gem::Version
|
219
|
-
version: '2.
|
230
|
+
version: '2.5'
|
220
231
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
232
|
requirements:
|
222
233
|
- - ">="
|
223
234
|
- !ruby/object:Gem::Version
|
224
235
|
version: '0'
|
225
236
|
requirements: []
|
226
|
-
rubygems_version: 3.
|
237
|
+
rubygems_version: 3.1.4
|
227
238
|
signing_key:
|
228
239
|
specification_version: 4
|
229
240
|
summary: Ruby on Rails Mautic integration
|
@@ -1,14 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
// require rails-ujs
|
14
|
-
//= require_tree .
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
-
* It is generally better to create a new file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|
@@ -1,80 +0,0 @@
|
|
1
|
-
body {
|
2
|
-
background-color: #fff;
|
3
|
-
color: #333;
|
4
|
-
margin: 33px;
|
5
|
-
}
|
6
|
-
|
7
|
-
body, p, ol, ul, td {
|
8
|
-
font-family: verdana, arial, helvetica, sans-serif;
|
9
|
-
font-size: 13px;
|
10
|
-
line-height: 18px;
|
11
|
-
}
|
12
|
-
|
13
|
-
pre {
|
14
|
-
background-color: #eee;
|
15
|
-
padding: 10px;
|
16
|
-
font-size: 11px;
|
17
|
-
}
|
18
|
-
|
19
|
-
a {
|
20
|
-
color: #000;
|
21
|
-
}
|
22
|
-
|
23
|
-
a:visited {
|
24
|
-
color: #666;
|
25
|
-
}
|
26
|
-
|
27
|
-
a:hover {
|
28
|
-
color: #fff;
|
29
|
-
background-color: #000;
|
30
|
-
}
|
31
|
-
|
32
|
-
th {
|
33
|
-
padding-bottom: 5px;
|
34
|
-
}
|
35
|
-
|
36
|
-
td {
|
37
|
-
padding: 0 5px 7px;
|
38
|
-
}
|
39
|
-
|
40
|
-
div.field,
|
41
|
-
div.actions {
|
42
|
-
margin-bottom: 10px;
|
43
|
-
}
|
44
|
-
|
45
|
-
#notice {
|
46
|
-
color: green;
|
47
|
-
}
|
48
|
-
|
49
|
-
.field_with_errors {
|
50
|
-
padding: 2px;
|
51
|
-
background-color: red;
|
52
|
-
display: table;
|
53
|
-
}
|
54
|
-
|
55
|
-
#error_explanation {
|
56
|
-
width: 450px;
|
57
|
-
border: 2px solid red;
|
58
|
-
padding: 7px 7px 0;
|
59
|
-
margin-bottom: 20px;
|
60
|
-
background-color: #f0f0f0;
|
61
|
-
}
|
62
|
-
|
63
|
-
#error_explanation h2 {
|
64
|
-
text-align: left;
|
65
|
-
font-weight: bold;
|
66
|
-
padding: 5px 5px 5px 15px;
|
67
|
-
font-size: 12px;
|
68
|
-
margin: -7px -7px 0;
|
69
|
-
background-color: #c00;
|
70
|
-
color: #fff;
|
71
|
-
}
|
72
|
-
|
73
|
-
#error_explanation ul li {
|
74
|
-
font-size: 12px;
|
75
|
-
list-style: square;
|
76
|
-
}
|
77
|
-
|
78
|
-
label {
|
79
|
-
display: block;
|
80
|
-
}
|