nuntius 1.4.12 → 1.4.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 +4 -4
- data/app/controllers/nuntius/subscribers_controller.rb +1 -0
- data/app/models/nuntius/message.rb +2 -0
- data/app/models/nuntius/subscriber.rb +10 -0
- data/app/providers/nuntius/smtp_mail_provider.rb +13 -0
- data/app/services/nuntius/deliver_campaign_service.rb +2 -7
- data/app/tables/nuntius/campaigns_table.rb +1 -1
- data/app/transports/nuntius/mail_transport.rb +1 -3
- data/app/views/nuntius/subscribers/show.html.slim +2 -2
- data/config/locales/en.yml +5 -0
- data/config/locales/nl.yml +6 -1
- data/db/migrate/20260310153208_add_subscriber_to_message.rb +5 -0
- data/lib/nuntius/engine.rb +0 -1
- data/lib/nuntius/version.rb +1 -1
- metadata +3 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 650cc4b129b084d4fb17dd3b3b21c2a44f9cf14fb6c10d0d3902baa67bfb66fb
|
|
4
|
+
data.tar.gz: 004110c56dc8b127dc38170a5249135ff1d71700f219aa460b8e62866cdc2107
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f3601b35b149815c37e3056e003d0a6e6900bd20b7bdcd2b17f82b04170fd873ac6aebe85cf3da41f351f11080420e350f2dd554bfd6f026ea2c75c91d4e623
|
|
7
|
+
data.tar.gz: 9c48531460a4e2d1c5f8a7747ef17712e128ee00f1f57e78d6187a615d3bcd97485ee268b1dd33b445b1e29ab0b5e0ff280c01a7cfab13f9726f6a72cc6d5416
|
|
@@ -5,6 +5,7 @@ require_dependency "nuntius/application_controller"
|
|
|
5
5
|
module Nuntius
|
|
6
6
|
class SubscribersController < ApplicationController
|
|
7
7
|
# skip_before_action :authenticate_user!, only: %i[show destroy]
|
|
8
|
+
skip_before_action :verify_authenticity_token, only: :unsubscribe
|
|
8
9
|
layout "empty"
|
|
9
10
|
|
|
10
11
|
def show
|
|
@@ -18,6 +18,8 @@ module Nuntius
|
|
|
18
18
|
belongs_to :campaign, optional: true
|
|
19
19
|
belongs_to :template, optional: true
|
|
20
20
|
belongs_to :parent_message, class_name: "Message", optional: true
|
|
21
|
+
belongs_to :subscriber, optional: true
|
|
22
|
+
|
|
21
23
|
has_many :child_messages, class_name: "Message", foreign_key: "parent_message_id", dependent: :destroy
|
|
22
24
|
has_many :message_trackings, class_name: "MessageTracking", dependent: :destroy
|
|
23
25
|
|
|
@@ -32,5 +32,15 @@ module Nuntius
|
|
|
32
32
|
|
|
33
33
|
super
|
|
34
34
|
end
|
|
35
|
+
|
|
36
|
+
def link(campaign, message, tag: true)
|
|
37
|
+
link_text = campaign.metadata["subscriber_url_text"] || I18n.t("subscriber_url_text")
|
|
38
|
+
url = Nuntius::Engine.routes.url_helpers.subscriber_url(self, host: Nuntius.config.host(message), protocol: "https")
|
|
39
|
+
tag ? "<a href=\"#{url}\" data-nuntius-tracking=\"false\">#{link_text}</a>" : url
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def unsubscribe_link(campaign, message)
|
|
43
|
+
Nuntius::Engine.routes.url_helpers.unsubscribe_subscriber_url(self, host: Nuntius.config.host(message), protocol: "https")
|
|
44
|
+
end
|
|
35
45
|
end
|
|
36
46
|
end
|
|
@@ -15,6 +15,7 @@ module Nuntius
|
|
|
15
15
|
setting_reader :ssl, required: false, default: false, description: "Whether to use SSL or not"
|
|
16
16
|
|
|
17
17
|
def deliver
|
|
18
|
+
return no_recipient if message.to.blank?
|
|
18
19
|
return block unless MailAllowList.new(settings[:allow_list]).allowed?(message.to)
|
|
19
20
|
return block if Nuntius::Message.where(status: %w[complaint bounced], to: message.to).count >= 1
|
|
20
21
|
|
|
@@ -24,6 +25,13 @@ module Nuntius
|
|
|
24
25
|
Mail.new(from: from_header)
|
|
25
26
|
end
|
|
26
27
|
|
|
28
|
+
mail.header["X-Nuntius-Message-Id"] = message.id
|
|
29
|
+
|
|
30
|
+
if message.campaign.present? && message.subscriber.present?
|
|
31
|
+
mail.header["List-Unsubscribe"] = "<" + message.subscriber.unsubscribe_link(message.campaign, message) + ">"
|
|
32
|
+
mail.header["List-Unsubscribe-Post"] = "List-Unsubscribe=One-Click"
|
|
33
|
+
end
|
|
34
|
+
|
|
27
35
|
if Rails.env.test?
|
|
28
36
|
mail.delivery_method :test
|
|
29
37
|
else
|
|
@@ -85,6 +93,11 @@ module Nuntius
|
|
|
85
93
|
message
|
|
86
94
|
end
|
|
87
95
|
|
|
96
|
+
def no_recipient
|
|
97
|
+
message.status = "no_recipient"
|
|
98
|
+
message
|
|
99
|
+
end
|
|
100
|
+
|
|
88
101
|
private
|
|
89
102
|
|
|
90
103
|
def message_url(message)
|
|
@@ -22,11 +22,11 @@ module Nuntius
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def new_message(subscriber, assigns = {})
|
|
25
|
-
message = Nuntius::Message.create!(transport: campaign.transport, campaign: campaign, nuntiable: subscriber.nuntiable, metadata: campaign.metadata)
|
|
25
|
+
message = Nuntius::Message.create!(transport: campaign.transport, campaign: campaign, nuntiable: subscriber.nuntiable, metadata: campaign.metadata, subscriber: subscriber)
|
|
26
26
|
|
|
27
27
|
assigns["campaign"] = context.campaign
|
|
28
28
|
assigns["subscriber"] = subscriber
|
|
29
|
-
assigns["subscriber_link"] =
|
|
29
|
+
assigns["subscriber_link"] = subscriber.link(campaign, message)
|
|
30
30
|
|
|
31
31
|
if subscriber.nuntiable
|
|
32
32
|
name = Nuntius::BaseMessenger.liquid_variable_name_for(subscriber.nuntiable)
|
|
@@ -62,11 +62,6 @@ module Nuntius
|
|
|
62
62
|
scope.join(".")
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
-
def subscriber_link(subscriber, message)
|
|
66
|
-
url = Nuntius::Engine.routes.url_helpers.subscriber_url(subscriber, host: Nuntius.config.host(message))
|
|
67
|
-
"<a href=\"#{url}\" data-nuntius-tracking=\"false\">#{t("subscriber_url_text")}</a>"
|
|
68
|
-
end
|
|
69
|
-
|
|
70
65
|
private
|
|
71
66
|
|
|
72
67
|
def render(attr, assigns, locale, options = {})
|
|
@@ -25,7 +25,7 @@ module Nuntius
|
|
|
25
25
|
show ->(campaign) { campaign.transport != "sms" && campaign.can_publish? }
|
|
26
26
|
link { |campaign| campaign.can_publish? ? nuntius.publish_admin_campaign_path(campaign) : nil }
|
|
27
27
|
icon "fa-solid fa-paper-plane"
|
|
28
|
-
link_attributes data: {"turbo-confirm": "
|
|
28
|
+
link_attributes data: {"turbo-confirm": t(".campaign_publish_confirm"), "turbo-method": :post}
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
order name: :asc
|
|
@@ -4,15 +4,13 @@ module Nuntius
|
|
|
4
4
|
class MailTransport < BaseTransport
|
|
5
5
|
# We split per email address, to allow easy resends
|
|
6
6
|
def deliver(message)
|
|
7
|
-
message.html = Inky::Core.new.release_the_kraken(message.html)
|
|
8
|
-
|
|
9
7
|
premailer = Premailer.new(message.html, with_html_string: true)
|
|
10
8
|
message.html = premailer.to_inline_css
|
|
11
9
|
message.text = premailer.to_plain_text
|
|
12
10
|
|
|
13
11
|
message.request_id = SecureRandom.uuid
|
|
14
12
|
|
|
15
|
-
tos = message.to.split(/[\s;,]+/)
|
|
13
|
+
tos = message.to.to_s.split(/[\s;,]+/)
|
|
16
14
|
|
|
17
15
|
messages = []
|
|
18
16
|
message.to = tos.first
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
= sts.card :subscriber, title: @list.name do |card|
|
|
3
3
|
- card.with_action
|
|
4
4
|
- if @subscriber.unsubscribed_at.present?
|
|
5
|
-
= link_to '
|
|
5
|
+
= link_to t('.resubscribe'), subscribe_subscriber_path(@subscriber), data: { turbo_method: :post }, class: 'button'
|
|
6
6
|
- else
|
|
7
|
-
= link_to '
|
|
7
|
+
= link_to t('.unsubscribe'), unsubscribe_subscriber_path(@subscriber), data: { turbo_method: :post }, class: 'button primary'
|
|
8
8
|
|
|
9
9
|
p== sanitize @list.description
|
data/config/locales/en.yml
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
en:
|
|
2
|
+
campaign_publish_confirm: "Are you sure you want to send out this campaign?"
|
|
2
3
|
subscriber_url_text: "Click here to unsubscribe"
|
|
3
4
|
choose_files: Choose files
|
|
4
5
|
activerecord:
|
|
@@ -178,6 +179,10 @@ en:
|
|
|
178
179
|
tab:
|
|
179
180
|
Nuntius templates: Templates
|
|
180
181
|
title: Templates
|
|
182
|
+
subscribers:
|
|
183
|
+
show:
|
|
184
|
+
unsubscribe: Unsubscribe
|
|
185
|
+
resubscribe: Resubscribe
|
|
181
186
|
context_menu:
|
|
182
187
|
resend: Resend
|
|
183
188
|
root: Root
|
data/config/locales/nl.yml
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
nl:
|
|
2
|
-
|
|
2
|
+
campaign_publish_confirm: "Weet je zeker dat je deze campagne wilt verzenden?"
|
|
3
|
+
subscriber_url_text: "Klik hier om je uit te schrijven"
|
|
3
4
|
choose_files: Kies bestanden
|
|
4
5
|
activerecord:
|
|
5
6
|
attributes:
|
|
@@ -193,6 +194,10 @@ nl:
|
|
|
193
194
|
tab:
|
|
194
195
|
Nuntius templates: Templates
|
|
195
196
|
title: Templates
|
|
197
|
+
subscribers:
|
|
198
|
+
show:
|
|
199
|
+
unsubscribe: Uitschrijven
|
|
200
|
+
resubscribe: Opnieuw inschrijven
|
|
196
201
|
context_menu:
|
|
197
202
|
resend: Verstuur opnieuw
|
|
198
203
|
root: Root
|
data/lib/nuntius/engine.rb
CHANGED
data/lib/nuntius/version.rb
CHANGED
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.
|
|
4
|
+
version: 1.4.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom de Grunt
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-03-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: apnotic
|
|
@@ -108,20 +108,6 @@ dependencies:
|
|
|
108
108
|
- - "~>"
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: 1.8.5
|
|
111
|
-
- !ruby/object:Gem::Dependency
|
|
112
|
-
name: inky-rb
|
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
|
114
|
-
requirements:
|
|
115
|
-
- - "~>"
|
|
116
|
-
- !ruby/object:Gem::Version
|
|
117
|
-
version: '1.4'
|
|
118
|
-
type: :runtime
|
|
119
|
-
prerelease: false
|
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
-
requirements:
|
|
122
|
-
- - "~>"
|
|
123
|
-
- !ruby/object:Gem::Version
|
|
124
|
-
version: '1.4'
|
|
125
111
|
- !ruby/object:Gem::Dependency
|
|
126
112
|
name: labelary
|
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -567,6 +553,7 @@ files:
|
|
|
567
553
|
- db/migrate/20260123160443_change_nuntius_events_id.rb
|
|
568
554
|
- db/migrate/20260210122500_add_tracking_to_nuntius_messages.rb
|
|
569
555
|
- db/migrate/20260225123822_add_metadata_to_subscriber.rb
|
|
556
|
+
- db/migrate/20260310153208_add_subscriber_to_message.rb
|
|
570
557
|
- lib/generators/nuntius/install_generator.rb
|
|
571
558
|
- lib/generators/nuntius/tailwind_config_generator.rb
|
|
572
559
|
- lib/generators/nuntius/templates/config/initializers/nuntius.rb
|