nuntius 1.0.27 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +77 -18
- data/Rakefile +16 -39
- data/app/controllers/nuntius/admin/campaigns_controller.rb +12 -10
- data/app/controllers/nuntius/admin/layouts/attachments_controller.rb +2 -1
- data/app/controllers/nuntius/admin/layouts_controller.rb +1 -1
- data/app/controllers/nuntius/admin/lists/subscribers_controller.rb +1 -1
- data/app/controllers/nuntius/admin/lists_controller.rb +4 -4
- data/app/controllers/nuntius/admin/locales_controller.rb +3 -2
- data/app/controllers/nuntius/admin/messages_controller.rb +2 -2
- data/app/controllers/nuntius/admin/templates_controller.rb +1 -1
- data/app/controllers/nuntius/api/events_controller.rb +2 -2
- data/app/controllers/nuntius/application_admin_controller.rb +1 -1
- data/app/controllers/nuntius/callbacks_controller.rb +4 -4
- data/app/controllers/nuntius/dashboard_controller.rb +1 -1
- data/app/controllers/nuntius/feedback_controller.rb +1 -2
- data/app/controllers/nuntius/inbound_messages/twilio_inbound_smses_controller.rb +7 -7
- data/app/controllers/nuntius/messages_controller.rb +1 -1
- data/app/controllers/nuntius/subscribers_controller.rb +33 -0
- data/app/drops/nuntius/list_drop.rb +7 -0
- data/app/drops/nuntius/subscriber_drop.rb +7 -0
- data/app/exceptions/nuntius/base_exception.rb +2 -0
- data/app/exceptions/nuntius/missing_messenger_exception.rb +2 -0
- data/app/helpers/nuntius/application_helper.rb +6 -11
- data/app/jobs/nuntius/deliver_inbound_message_job.rb +1 -1
- data/app/jobs/nuntius/purge_message_job.rb +2 -2
- data/app/jobs/nuntius/retrieve_mail_job.rb +2 -2
- data/app/jobs/nuntius/transport_delivery_job.rb +2 -2
- data/app/message_boxes/nuntius/base_message_box.rb +46 -23
- data/app/messengers/nuntius/base_messenger.rb +13 -12
- data/app/models/nuntius/application_record.rb +1 -1
- data/app/models/nuntius/attachment.rb +4 -2
- data/app/models/nuntius/campaign.rb +4 -51
- data/app/models/nuntius/concerns/yamlify.rb +2 -2
- data/app/models/nuntius/inbound_message.rb +2 -0
- data/app/models/nuntius/list.rb +11 -1
- data/app/models/nuntius/message.rb +34 -29
- data/app/models/nuntius/subscriber.rb +21 -1
- data/app/models/nuntius/template.rb +20 -20
- data/app/presenters/application_presenter.rb +1 -1
- data/app/presenters/template_presenter.rb +3 -3
- data/app/providers/nuntius/apnotic_push_provider.rb +17 -17
- data/app/providers/nuntius/base_provider.rb +6 -6
- data/app/providers/nuntius/firebase_push_provider.rb +8 -8
- data/app/providers/nuntius/houston_push_provider.rb +15 -15
- data/app/providers/nuntius/message_bird_sms_provider.rb +7 -7
- data/app/providers/nuntius/slack_slack_provider.rb +7 -7
- data/app/providers/nuntius/smtp_mail_provider.rb +36 -28
- data/app/providers/nuntius/teams_teams_provider.rb +24 -0
- data/app/providers/nuntius/twilio_sms_provider.rb +4 -4
- data/app/providers/nuntius/twilio_voice_provider.rb +13 -13
- data/app/services/nuntius/aws_sns_processor_service.rb +11 -11
- data/app/services/nuntius/deliver_campaign_service.rb +65 -0
- data/app/services/nuntius/deliver_inbound_message_service.rb +3 -2
- data/app/services/nuntius/retrieve_inbound_mail_service.rb +23 -16
- data/app/tables/nuntius_campaigns_table.rb +10 -1
- data/app/tables/nuntius_layouts_table.rb +4 -4
- data/app/tables/nuntius_lists_table.rb +1 -1
- data/app/tables/nuntius_locales_table.rb +1 -1
- data/app/tables/nuntius_messages_table.rb +5 -5
- data/app/tables/nuntius_subscribers_table.rb +3 -2
- data/app/tables/nuntius_templates_table.rb +12 -5
- data/app/transports/nuntius/base_transport.rb +1 -1
- data/app/transports/nuntius/mail_transport.rb +1 -1
- data/app/transports/nuntius/push_transport.rb +1 -1
- data/app/transports/nuntius/teams_transport.rb +6 -0
- data/app/views/nuntius/admin/campaigns/edit.html.slim +12 -16
- data/app/views/nuntius/admin/campaigns/index.html.slim +2 -2
- data/app/views/nuntius/admin/layouts/attachments/create.json.jbuilder +3 -3
- data/app/views/nuntius/admin/layouts/edit.html.slim +18 -19
- data/app/views/nuntius/admin/layouts/index.html.slim +2 -2
- data/app/views/nuntius/admin/lists/edit.html.slim +19 -9
- data/app/views/nuntius/admin/lists/index.html.slim +2 -2
- data/app/views/nuntius/admin/lists/subscribers/edit.html.slim +2 -2
- data/app/views/nuntius/admin/locales/edit.html.slim +3 -3
- data/app/views/nuntius/admin/locales/index.html.slim +2 -2
- data/app/views/nuntius/admin/messages/index.html.slim +2 -2
- data/app/views/nuntius/admin/messages/show.html.slim +12 -12
- data/app/views/nuntius/admin/templates/edit.html.slim +62 -64
- data/app/views/nuntius/admin/templates/index.html.slim +2 -2
- data/app/views/nuntius/dashboard/show.html.slim +2 -6
- data/app/views/nuntius/subscribers/show.html.slim +9 -0
- data/config/locales/en.yml +97 -1
- data/config/routes.rb +18 -8
- data/db/migrate/20190301201541_create_nuntius_templates.rb +5 -5
- data/db/migrate/20190301202436_create_nuntius_messages.rb +4 -4
- data/db/migrate/20190322114340_create_nuntius_campaigns.rb +2 -2
- data/db/migrate/20190322121338_create_nuntius_subscribers.rb +1 -1
- data/db/migrate/20190327124407_create_nuntius_layouts.rb +5 -5
- data/db/migrate/20190327143921_add_campaign_to_message.rb +1 -1
- data/db/migrate/20190417125153_change_message_status_default.rb +2 -2
- data/db/migrate/20190825080757_update_nuntius_message_sending_to_sent.rb +2 -2
- data/db/migrate/20200220154927_change_nuntius_templates_payload_type.rb +1 -1
- data/db/migrate/20200318095339_create_nuntius_attachments.rb +2 -2
- data/db/migrate/20201121185718_create_nuntius_inbound_messages.rb +1 -1
- data/db/migrate/20240205204719_add_description_to_list.rb +5 -0
- data/db/migrate/20240206203019_add_slug_to_nuntius_list.rb +9 -0
- data/lib/nuntius/active_record_helpers.rb +4 -4
- data/lib/nuntius/configuration.rb +64 -27
- data/lib/nuntius/deprecator.rb +2 -0
- data/lib/nuntius/devise.rb +1 -1
- data/lib/nuntius/engine.rb +13 -27
- data/lib/nuntius/i18n_store.rb +6 -5
- data/lib/nuntius/liquid/tags/attach_tag.rb +11 -11
- data/lib/nuntius/mail_allow_list.rb +2 -2
- data/lib/nuntius/nuntiable.rb +3 -1
- data/lib/nuntius/transactio.rb +1 -1
- data/lib/nuntius/version.rb +1 -1
- data/lib/nuntius.rb +13 -27
- data/lib/preamble.rb +18 -18
- data/lib/tasks/nuntius_tasks.rake +4 -4
- metadata +48 -33
- data/app/jobs/nuntius/process_inbound_message_job.rb +0 -10
- data/app/reportlets/nuntius/application_reportlet.rb +0 -35
- data/app/reportlets/nuntius/daily_messages_per_template_reportlet.rb +0 -50
- data/config/webpack/development.js +0 -5
- data/config/webpack/environment.js +0 -4
- data/config/webpack/production.js +0 -5
- data/config/webpack/test.js +0 -5
- data/config/webpacker.yml +0 -119
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "mail"
|
4
4
|
|
5
5
|
module Nuntius
|
6
6
|
class MailAllowList
|
@@ -14,7 +14,7 @@ module Nuntius
|
|
14
14
|
|
15
15
|
mail_to = Mail::Address.new(email.downcase)
|
16
16
|
allow_list_match = @allow_list.detect do |allow|
|
17
|
-
allow == (allow.include?(
|
17
|
+
allow == (allow.include?("@") ? mail_to.to_s : mail_to.domain)
|
18
18
|
end
|
19
19
|
|
20
20
|
allow_list_match.present?
|
data/lib/nuntius/nuntiable.rb
CHANGED
@@ -18,7 +18,9 @@ module Nuntius
|
|
18
18
|
raise "Nuntius Messenger has not been implemented for class #{name}" unless messenger
|
19
19
|
|
20
20
|
Nuntius.config.add_nuntiable_class(self)
|
21
|
-
has_many :messages, as: :nuntiable, class_name:
|
21
|
+
has_many :messages, as: :nuntiable, class_name: "Nuntius::Message", dependent: :delete_all
|
22
|
+
has_many :nuntius_subscriptions, as: :nuntiable, class_name: "Nuntius::Subscriber", dependent: :delete_all
|
23
|
+
has_many :nuntius_lists, through: :nuntius_subscriptions, class_name: "Nuntius::List", source: :list
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
data/lib/nuntius/transactio.rb
CHANGED
@@ -22,7 +22,7 @@ module Nuntius
|
|
22
22
|
params = Nuntius.config.default_params(transaction_log_entry)
|
23
23
|
|
24
24
|
Nuntius.event(event, resource, params)
|
25
|
-
Nuntius.event(
|
25
|
+
Nuntius.event("save", resource, params) if %w[create update].include?(event)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/lib/nuntius/version.rb
CHANGED
data/lib/nuntius.rb
CHANGED
@@ -1,34 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
|
11
|
-
require 'nuntius/deprecator'
|
12
|
-
require 'nuntius/engine'
|
13
|
-
require 'nuntius/configuration'
|
14
|
-
require 'nuntius/active_record_helpers'
|
15
|
-
require 'nuntius/active_storage_helpers'
|
16
|
-
require 'nuntius/i18n_store'
|
17
|
-
require 'nuntius/mail_allow_list'
|
3
|
+
require "nuntius/deprecator"
|
4
|
+
require "nuntius/engine"
|
5
|
+
require "nuntius/configuration"
|
6
|
+
require "nuntius/active_record_helpers"
|
7
|
+
require "nuntius/active_storage_helpers"
|
8
|
+
require "nuntius/i18n_store"
|
9
|
+
require "nuntius/mail_allow_list"
|
18
10
|
|
19
11
|
module Nuntius
|
20
|
-
|
12
|
+
extend Configurable
|
13
|
+
ROOT_PATH = Pathname.new(File.join(__dir__, ".."))
|
21
14
|
|
22
15
|
class Error < StandardError; end
|
23
16
|
|
24
17
|
class << self
|
25
|
-
attr_reader :config
|
26
|
-
|
27
|
-
def setup
|
28
|
-
@config = Configuration.new
|
29
|
-
yield config
|
30
|
-
end
|
31
|
-
|
32
18
|
def i18n_store
|
33
19
|
@i18n_store ||= Nuntius::I18nStore.new
|
34
20
|
end
|
@@ -59,14 +45,14 @@ module Nuntius
|
|
59
45
|
end
|
60
46
|
|
61
47
|
def active_storage_enabled?
|
62
|
-
ActiveRecord::Base.connection.table_exists?
|
48
|
+
ActiveRecord::Base.connection.table_exists? "active_storage_attachments"
|
63
49
|
end
|
64
50
|
|
65
51
|
def templates?(obj, event)
|
66
52
|
Nuntius::Template.where(klass: Nuntius::BaseMessenger.class_names_for(obj),
|
67
|
-
|
68
|
-
|
69
|
-
|
53
|
+
event: Nuntius::BaseMessenger.event_name_for(
|
54
|
+
obj, event
|
55
|
+
)).where(enabled: true).count.positive?
|
70
56
|
end
|
71
57
|
end
|
72
58
|
|
data/lib/preamble.rb
CHANGED
@@ -9,11 +9,11 @@ class Preamble
|
|
9
9
|
|
10
10
|
def initialize(metadata, content)
|
11
11
|
@metadata = metadata
|
12
|
-
@content
|
12
|
+
@content = content
|
13
13
|
end
|
14
14
|
|
15
15
|
def metadata_with_content
|
16
|
-
@metadata.to_yaml
|
16
|
+
"#{@metadata.to_yaml}---\n#{@content}"
|
17
17
|
end
|
18
18
|
|
19
19
|
def dump
|
@@ -29,8 +29,8 @@ class Preamble
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.parse(data)
|
32
|
-
preamble_lines = +
|
33
|
-
content_lines
|
32
|
+
preamble_lines = +""
|
33
|
+
content_lines = +""
|
34
34
|
|
35
35
|
state = :before_preamble
|
36
36
|
|
@@ -42,24 +42,24 @@ class Preamble
|
|
42
42
|
when :before_preamble
|
43
43
|
|
44
44
|
new_state = case stripped
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
when "---"
|
46
|
+
:preamble
|
47
|
+
when ""
|
48
|
+
:before_preamble
|
49
|
+
else
|
50
|
+
content_lines << line
|
51
|
+
:after_preamble
|
52
|
+
end
|
53
53
|
|
54
54
|
when :preamble
|
55
55
|
|
56
56
|
new_state = case stripped
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
when "---"
|
58
|
+
:after_preamble
|
59
|
+
else
|
60
|
+
preamble_lines << line
|
61
|
+
:preamble
|
62
|
+
end
|
63
63
|
|
64
64
|
when :after_preamble
|
65
65
|
new_state = :after_preamble
|
@@ -1,15 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
desc
|
3
|
+
desc "Release a new version"
|
4
4
|
namespace :nuntius do
|
5
5
|
task :release do
|
6
|
-
version_file =
|
7
|
-
File.open(version_file,
|
6
|
+
version_file = "./lib/nuntius/version.rb"
|
7
|
+
File.open(version_file, "w") do |file|
|
8
8
|
file.puts <<~EOVERSION
|
9
9
|
# frozen_string_literal: true
|
10
10
|
|
11
11
|
module Nuntius
|
12
|
-
VERSION = '#{Nuntius::VERSION.split(
|
12
|
+
VERSION = '#{Nuntius::VERSION.split(".").map(&:to_i).tap { |parts| parts[2] += 1 }.join(".")}'
|
13
13
|
end
|
14
14
|
EOVERSION
|
15
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nuntius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom de Grunt
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apnotic
|
@@ -95,31 +95,45 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '2.4'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: faraday
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.9'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.9'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: faraday-follow_redirects
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
117
|
+
version: '0'
|
104
118
|
type: :runtime
|
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'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: i18n
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
|
-
- -
|
129
|
+
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
131
|
version: 1.8.5
|
118
132
|
type: :runtime
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
|
-
- -
|
136
|
+
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
138
|
version: 1.8.5
|
125
139
|
- !ruby/object:Gem::Dependency
|
@@ -154,16 +168,16 @@ dependencies:
|
|
154
168
|
name: liquidum
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
156
170
|
requirements:
|
157
|
-
- - "
|
171
|
+
- - "~>"
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
173
|
+
version: '1'
|
160
174
|
type: :runtime
|
161
175
|
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
|
-
- - "
|
178
|
+
- - "~>"
|
165
179
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
180
|
+
version: '1'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: mail
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -268,14 +282,14 @@ dependencies:
|
|
268
282
|
requirements:
|
269
283
|
- - ">="
|
270
284
|
- !ruby/object:Gem::Version
|
271
|
-
version: '
|
285
|
+
version: '7'
|
272
286
|
type: :runtime
|
273
287
|
prerelease: false
|
274
288
|
version_requirements: !ruby/object:Gem::Requirement
|
275
289
|
requirements:
|
276
290
|
- - ">="
|
277
291
|
- !ruby/object:Gem::Version
|
278
|
-
version: '
|
292
|
+
version: '7'
|
279
293
|
- !ruby/object:Gem::Dependency
|
280
294
|
name: rubyzip
|
281
295
|
requirement: !ruby/object:Gem::Requirement
|
@@ -347,35 +361,35 @@ dependencies:
|
|
347
361
|
- !ruby/object:Gem::Version
|
348
362
|
version: '5'
|
349
363
|
- !ruby/object:Gem::Dependency
|
350
|
-
name:
|
364
|
+
name: slim-rails
|
351
365
|
requirement: !ruby/object:Gem::Requirement
|
352
366
|
requirements:
|
353
|
-
- - "
|
367
|
+
- - "~>"
|
354
368
|
- !ruby/object:Gem::Version
|
355
|
-
version: '
|
369
|
+
version: '3.6'
|
356
370
|
type: :runtime
|
357
371
|
prerelease: false
|
358
372
|
version_requirements: !ruby/object:Gem::Requirement
|
359
373
|
requirements:
|
360
|
-
- - "
|
374
|
+
- - "~>"
|
361
375
|
- !ruby/object:Gem::Version
|
362
|
-
version: '
|
376
|
+
version: '3.6'
|
363
377
|
- !ruby/object:Gem::Dependency
|
364
378
|
name: pry
|
365
379
|
requirement: !ruby/object:Gem::Requirement
|
366
380
|
requirements:
|
367
381
|
- - "~>"
|
368
382
|
- !ruby/object:Gem::Version
|
369
|
-
version: '0
|
383
|
+
version: '0'
|
370
384
|
type: :development
|
371
385
|
prerelease: false
|
372
386
|
version_requirements: !ruby/object:Gem::Requirement
|
373
387
|
requirements:
|
374
388
|
- - "~>"
|
375
389
|
- !ruby/object:Gem::Version
|
376
|
-
version: '0
|
390
|
+
version: '0'
|
377
391
|
- !ruby/object:Gem::Dependency
|
378
|
-
name:
|
392
|
+
name: standard
|
379
393
|
requirement: !ruby/object:Gem::Requirement
|
380
394
|
requirements:
|
381
395
|
- - "~>"
|
@@ -414,10 +428,13 @@ files:
|
|
414
428
|
- app/controllers/nuntius/feedback_controller.rb
|
415
429
|
- app/controllers/nuntius/inbound_messages/twilio_inbound_smses_controller.rb
|
416
430
|
- app/controllers/nuntius/messages_controller.rb
|
431
|
+
- app/controllers/nuntius/subscribers_controller.rb
|
417
432
|
- app/drops/nuntius/application_drop.rb
|
418
433
|
- app/drops/nuntius/campaign_drop.rb
|
419
434
|
- app/drops/nuntius/layout_drop.rb
|
435
|
+
- app/drops/nuntius/list_drop.rb
|
420
436
|
- app/drops/nuntius/message_drop.rb
|
437
|
+
- app/drops/nuntius/subscriber_drop.rb
|
421
438
|
- app/drops/nuntius/template_drop.rb
|
422
439
|
- app/exceptions/nuntius/base_exception.rb
|
423
440
|
- app/exceptions/nuntius/missing_messenger_exception.rb
|
@@ -425,7 +442,6 @@ files:
|
|
425
442
|
- app/jobs/nuntius/application_job.rb
|
426
443
|
- app/jobs/nuntius/deliver_inbound_message_job.rb
|
427
444
|
- app/jobs/nuntius/messenger_job.rb
|
428
|
-
- app/jobs/nuntius/process_inbound_message_job.rb
|
429
445
|
- app/jobs/nuntius/purge_message_job.rb
|
430
446
|
- app/jobs/nuntius/retrieve_mail_job.rb
|
431
447
|
- app/jobs/nuntius/transport_delivery_job.rb
|
@@ -454,15 +470,15 @@ files:
|
|
454
470
|
- app/providers/nuntius/message_bird_sms_provider.rb
|
455
471
|
- app/providers/nuntius/slack_slack_provider.rb
|
456
472
|
- app/providers/nuntius/smtp_mail_provider.rb
|
473
|
+
- app/providers/nuntius/teams_teams_provider.rb
|
457
474
|
- app/providers/nuntius/twilio_sms_provider.rb
|
458
475
|
- app/providers/nuntius/twilio_voice_provider.rb
|
459
|
-
- app/reportlets/nuntius/application_reportlet.rb
|
460
|
-
- app/reportlets/nuntius/daily_messages_per_template_reportlet.rb
|
461
476
|
- app/runners/nuntius/application_runner.rb
|
462
477
|
- app/runners/nuntius/basic_application_runner.rb
|
463
478
|
- app/runners/nuntius/timebased_events_runner.rb
|
464
479
|
- app/services/nuntius/application_service.rb
|
465
480
|
- app/services/nuntius/aws_sns_processor_service.rb
|
481
|
+
- app/services/nuntius/deliver_campaign_service.rb
|
466
482
|
- app/services/nuntius/deliver_inbound_message_service.rb
|
467
483
|
- app/services/nuntius/retrieve_inbound_mail_service.rb
|
468
484
|
- app/tables/nuntius_campaigns_table.rb
|
@@ -477,6 +493,7 @@ files:
|
|
477
493
|
- app/transports/nuntius/push_transport.rb
|
478
494
|
- app/transports/nuntius/slack_transport.rb
|
479
495
|
- app/transports/nuntius/sms_transport.rb
|
496
|
+
- app/transports/nuntius/teams_transport.rb
|
480
497
|
- app/transports/nuntius/voice_transport.rb
|
481
498
|
- app/validators/liquid_validator.rb
|
482
499
|
- app/views/nuntius/admin/campaigns/edit.html.slim
|
@@ -497,14 +514,10 @@ files:
|
|
497
514
|
- app/views/nuntius/admin/templates/index.html.slim
|
498
515
|
- app/views/nuntius/dashboard/show.html.slim
|
499
516
|
- app/views/nuntius/messages/show.html.slim
|
517
|
+
- app/views/nuntius/subscribers/show.html.slim
|
500
518
|
- config/locales/en.yml
|
501
519
|
- config/locales/nl.yml
|
502
520
|
- config/routes.rb
|
503
|
-
- config/webpack/development.js
|
504
|
-
- config/webpack/environment.js
|
505
|
-
- config/webpack/production.js
|
506
|
-
- config/webpack/test.js
|
507
|
-
- config/webpacker.yml
|
508
521
|
- db/migrate/20190301201541_create_nuntius_templates.rb
|
509
522
|
- db/migrate/20190301202436_create_nuntius_messages.rb
|
510
523
|
- db/migrate/20190322112815_create_nuntius_lists.rb
|
@@ -528,6 +541,8 @@ files:
|
|
528
541
|
- db/migrate/20200430154032_make_html_processing_optional_revert.rb
|
529
542
|
- db/migrate/20201121185718_create_nuntius_inbound_messages.rb
|
530
543
|
- db/migrate/20220412114148_add_last_sent_to_message.rb
|
544
|
+
- db/migrate/20240205204719_add_description_to_list.rb
|
545
|
+
- db/migrate/20240206203019_add_slug_to_nuntius_list.rb
|
531
546
|
- lib/nuntius.rb
|
532
547
|
- lib/nuntius/active_record_helpers.rb
|
533
548
|
- lib/nuntius/active_storage_helpers.rb
|
@@ -548,7 +563,7 @@ homepage: https://github.com/entdec/nuntius
|
|
548
563
|
licenses:
|
549
564
|
- MIT
|
550
565
|
metadata: {}
|
551
|
-
post_install_message:
|
566
|
+
post_install_message:
|
552
567
|
rdoc_options: []
|
553
568
|
require_paths:
|
554
569
|
- lib
|
@@ -563,8 +578,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
563
578
|
- !ruby/object:Gem::Version
|
564
579
|
version: '0'
|
565
580
|
requirements: []
|
566
|
-
rubygems_version: 3.
|
567
|
-
signing_key:
|
581
|
+
rubygems_version: 3.4.10
|
582
|
+
signing_key:
|
568
583
|
specification_version: 4
|
569
584
|
summary: Messaging and notification for Ruby on Rails
|
570
585
|
test_files: []
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Initializes the appropriate Messenger class and calls the event method
|
4
|
-
module Nuntius
|
5
|
-
class ProcessInboundMessageJob < ApplicationJob
|
6
|
-
def perform(inbound_message)
|
7
|
-
Nuntius::DeliverInboundMessageService.perform(inbound_message: inbound_message)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Nuntius
|
4
|
-
class ApplicationReportlet < Trado::Reportlet
|
5
|
-
attr_reader :template_ids
|
6
|
-
|
7
|
-
def initialize(params)
|
8
|
-
@template_ids = params[:template_ids]
|
9
|
-
end
|
10
|
-
|
11
|
-
private
|
12
|
-
|
13
|
-
def ymds(_for_display = false)
|
14
|
-
results.map { |r| r['ymd'] }.uniq.sort_by { |w| Date.strptime(w, '%F') }
|
15
|
-
end
|
16
|
-
|
17
|
-
def all_templates
|
18
|
-
map_items(results, :template_id)
|
19
|
-
end
|
20
|
-
|
21
|
-
# Helper to get item for ymd, template_id
|
22
|
-
def ymd_template_id(ymd, template_id, what)
|
23
|
-
find_item(results, { ymd: ymd, template_id: template_id }, what)
|
24
|
-
end
|
25
|
-
|
26
|
-
# Arel helpers
|
27
|
-
def templates
|
28
|
-
Nuntius::Template.arel_table
|
29
|
-
end
|
30
|
-
|
31
|
-
def messages
|
32
|
-
Nuntius::Message.arel_table
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_dependency 'nuntius/application_reportlet'
|
4
|
-
|
5
|
-
module Nuntius
|
6
|
-
class DailyMessagesPerTemplateReportlet < ApplicationReportlet
|
7
|
-
title 'Daily messages per template'
|
8
|
-
cache 1.minute
|
9
|
-
|
10
|
-
def table_data
|
11
|
-
data = [[''] + ymds(true)]
|
12
|
-
|
13
|
-
matrix = all_templates.map do |template|
|
14
|
-
tmpl = Nuntius::Template.find(template)
|
15
|
-
if tmpl
|
16
|
-
template_ymd_totals = ymds.map { |ymd| h.link_to(ymd_template_id(ymd, template, :count), Nuntius::Engine.routes.url_helpers.admin_messages_path(template_id: template)) }
|
17
|
-
[h.link_to(tmpl.description, Nuntius::Engine.routes.url_helpers.edit_admin_template_path(tmpl))] + template_ymd_totals
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
if matrix.present?
|
22
|
-
data += matrix
|
23
|
-
else
|
24
|
-
data = []
|
25
|
-
end
|
26
|
-
data
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
def results
|
32
|
-
return @results if @results
|
33
|
-
|
34
|
-
select_manager = messages.project(
|
35
|
-
:template_id,
|
36
|
-
Arel.sql("CONCAT(EXTRACT(YEAR FROM created_at :: DATE) :: VARCHAR, '-', EXTRACT(MONTH FROM created_at :: DATE) :: VARCHAR, '-', EXTRACT(DAY FROM created_at :: DATE) :: VARCHAR) AS ymd"),
|
37
|
-
Arel.star.count
|
38
|
-
)
|
39
|
-
|
40
|
-
select_manager = select_manager.where(messages[:template_id].in(template_ids))
|
41
|
-
select_manager = select_manager.where(messages[:created_at].between(7.days.ago..Time.now))
|
42
|
-
|
43
|
-
select_manager = select_manager.group(:template_id, :ymd)
|
44
|
-
select_manager = select_manager.order(:template_id, :ymd)
|
45
|
-
|
46
|
-
Rails.logger.info select_manager.to_sql
|
47
|
-
@results = ActiveRecord::Base.connection.execute(select_manager.to_sql)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
data/config/webpack/test.js
DELETED
data/config/webpacker.yml
DELETED
@@ -1,119 +0,0 @@
|
|
1
|
-
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
2
|
-
|
3
|
-
default: &default
|
4
|
-
source_path: app/javascript
|
5
|
-
source_entry_path: packs
|
6
|
-
public_root_path: public
|
7
|
-
public_output_path: packs
|
8
|
-
cache_path: tmp/cache/webpacker
|
9
|
-
check_yarn_integrity: false
|
10
|
-
webpack_compile_output: false
|
11
|
-
|
12
|
-
# Additional paths webpack should lookup modules
|
13
|
-
# ['app/assets', 'engine/foo/app/assets']
|
14
|
-
resolved_paths: []
|
15
|
-
|
16
|
-
# Reload manifest.json on all requests so we reload latest compiled packs
|
17
|
-
cache_manifest: false
|
18
|
-
|
19
|
-
# Extract and emit a css file
|
20
|
-
extract_css: true
|
21
|
-
|
22
|
-
static_assets_extensions:
|
23
|
-
- .jpg
|
24
|
-
- .jpeg
|
25
|
-
- .png
|
26
|
-
- .gif
|
27
|
-
- .tiff
|
28
|
-
- .ico
|
29
|
-
- .svg
|
30
|
-
- .eot
|
31
|
-
- .otf
|
32
|
-
- .ttf
|
33
|
-
- .woff
|
34
|
-
- .woff2
|
35
|
-
|
36
|
-
extensions:
|
37
|
-
- .mjs
|
38
|
-
- .js
|
39
|
-
- .sass
|
40
|
-
- .scss
|
41
|
-
- .css
|
42
|
-
- .module.sass
|
43
|
-
- .module.scss
|
44
|
-
- .module.css
|
45
|
-
- .png
|
46
|
-
- .svg
|
47
|
-
- .gif
|
48
|
-
- .jpeg
|
49
|
-
- .jpg
|
50
|
-
|
51
|
-
development:
|
52
|
-
<<: *default
|
53
|
-
compile: true
|
54
|
-
|
55
|
-
# Verifies that versions and hashed value of the package contents in the project's package.json
|
56
|
-
check_yarn_integrity: true
|
57
|
-
|
58
|
-
# Reference: https://webpack.js.org/configuration/dev-server/
|
59
|
-
dev_server:
|
60
|
-
https: false
|
61
|
-
host: localhost
|
62
|
-
port: 3035
|
63
|
-
public: localexpress.dev
|
64
|
-
hmr: true
|
65
|
-
# Inline should be set to true if using HMR
|
66
|
-
inline: true
|
67
|
-
overlay: true
|
68
|
-
compress: true
|
69
|
-
disable_host_check: true
|
70
|
-
use_local_ip: false
|
71
|
-
quiet: false
|
72
|
-
headers:
|
73
|
-
'Access-Control-Allow-Origin': '*'
|
74
|
-
watch_options:
|
75
|
-
ignored: '**/node_modules/**'
|
76
|
-
|
77
|
-
|
78
|
-
test:
|
79
|
-
<<: *default
|
80
|
-
compile: true
|
81
|
-
|
82
|
-
# Compile test packs to a separate directory
|
83
|
-
public_output_path: packs-test
|
84
|
-
|
85
|
-
testing:
|
86
|
-
<<: *default
|
87
|
-
|
88
|
-
# Production depends on precompilation of packs prior to booting for performance.
|
89
|
-
compile: false
|
90
|
-
|
91
|
-
# Extract and emit a css file
|
92
|
-
extract_css: true
|
93
|
-
|
94
|
-
# Cache manifest.json for performance
|
95
|
-
cache_manifest: true
|
96
|
-
|
97
|
-
staging:
|
98
|
-
<<: *default
|
99
|
-
|
100
|
-
# Production depends on precompilation of packs prior to booting for performance.
|
101
|
-
compile: false
|
102
|
-
|
103
|
-
# Extract and emit a css file
|
104
|
-
extract_css: true
|
105
|
-
|
106
|
-
# Cache manifest.json for performance
|
107
|
-
cache_manifest: true
|
108
|
-
|
109
|
-
production:
|
110
|
-
<<: *default
|
111
|
-
|
112
|
-
# Production depends on precompilation of packs prior to booting for performance.
|
113
|
-
compile: false
|
114
|
-
|
115
|
-
# Extract and emit a css file
|
116
|
-
extract_css: true
|
117
|
-
|
118
|
-
# Cache manifest.json for performance
|
119
|
-
cache_manifest: true
|