nuntius 1.3.6 → 1.3.7
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 +2 -0
- data/app/controllers/nuntius/admin/campaigns_controller.rb +1 -1
- data/app/controllers/nuntius/admin/layouts_controller.rb +5 -1
- data/app/models/nuntius/campaign.rb +3 -0
- data/app/providers/nuntius/smtp_mail_provider.rb +2 -2
- data/app/services/nuntius/deliver_campaign_service.rb +7 -3
- data/app/tables/nuntius/campaign_messages_table.rb +24 -0
- data/app/views/nuntius/admin/campaigns/edit.html.slim +5 -13
- data/app/views/nuntius/admin/layouts/edit.html.slim +3 -2
- data/config/locales/en.yml +1 -0
- data/config/locales/nl.yml +1 -0
- data/lib/nuntius/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b687606f90025f60156f83577dbc1b9d4d2edecdc70f84e497141ff37476965
|
4
|
+
data.tar.gz: 8f17f799c7d5c991bb8141cb29dd0e026651dc24993ab67e1fe5ed77f47aebfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27c5d73a3fc860ecb126e2967f75c8d985faf47af0900d59b704be4cf8a00821525344570e1bd611d92fa3ea33689ed1d0420c6edc46d9d69fa2aae58b3b605a
|
7
|
+
data.tar.gz: 1152e80c5e52d47adc53ac5519e328852874495534daf54b4e96491acd911bbdba9e0001f61b30a1491506432b3accd0bf49971487709ee36240d525c2a5026e
|
data/README.md
CHANGED
@@ -165,6 +165,8 @@ The main key of the hash passed will also be the liquid variable.
|
|
165
165
|
|
166
166
|
Outbound mail is handled through SMTP. We've only exposed the HTML of mail, we can create text-versions based on sanitized HTML. HTML allows for [Foundation for Emails](https://get.foundation/emails/docs/index.html). You will have to include the CSS in the layouts.
|
167
167
|
|
168
|
+
In the layout you can add `<a href="{{message_url}}">Link to mail</a>` to provide a link to the online version of the message.
|
169
|
+
|
168
170
|
#### AWS SES
|
169
171
|
|
170
172
|
In case you use AWS SES, you can use the SNS Feedback Notifications to automatically mark messages as read, or deal with complaints and bounces. Create a AWS SNS topic, with a HTTPS subscription with the following URL (pattern):
|
@@ -51,7 +51,7 @@ module Nuntius
|
|
51
51
|
def campaign_params
|
52
52
|
return unless params[:campaign]
|
53
53
|
|
54
|
-
params.require(:campaign).permit(:name, :transport, :layout_id, :list_id, :from, :subject, :text, :html)
|
54
|
+
params.require(:campaign).permit(:name, :transport, :layout_id, :list_id, :from, :subject, :text, :html, :metadata_yaml)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -31,6 +31,11 @@ module Nuntius
|
|
31
31
|
def update
|
32
32
|
@layout = Nuntius::Layout.visible.find(params[:id])
|
33
33
|
@layout.update(layout_params)
|
34
|
+
if params[:layout][:attachments].present?
|
35
|
+
params[:layout][:attachments].each do |attachment|
|
36
|
+
@layout.attachments.attach(attachment)
|
37
|
+
end
|
38
|
+
end
|
34
39
|
respond_with :admin, @layout
|
35
40
|
end
|
36
41
|
|
@@ -44,7 +49,6 @@ module Nuntius
|
|
44
49
|
|
45
50
|
def layout_params
|
46
51
|
permitted = %i[name data metadata_yaml]
|
47
|
-
permitted += [attachments: []] if params[:layout][:attachments].compact_blank.present?
|
48
52
|
params.require(:layout).permit(permitted)
|
49
53
|
end
|
50
54
|
end
|
@@ -45,7 +45,7 @@ module Nuntius
|
|
45
45
|
charset: "UTF-8"
|
46
46
|
)
|
47
47
|
if message.html.present?
|
48
|
-
message.html = message.html.gsub("
|
48
|
+
message.html = message.html.gsub("{{message_url}}") { message_url(message) }
|
49
49
|
p.html_part = Mail::Part.new(
|
50
50
|
body: message.html,
|
51
51
|
content_type: "text/html",
|
@@ -84,7 +84,7 @@ module Nuntius
|
|
84
84
|
private
|
85
85
|
|
86
86
|
def message_url(message)
|
87
|
-
Nuntius::Engine.routes.url_helpers.message_url(message.id, host: Nuntius.config.host
|
87
|
+
Nuntius::Engine.routes.url_helpers.message_url(message.id, host: Nuntius.config.host(message))
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
@@ -11,7 +11,7 @@ module Nuntius
|
|
11
11
|
|
12
12
|
def perform
|
13
13
|
deliver
|
14
|
-
campaign.sent!
|
14
|
+
# campaign.sent!
|
15
15
|
end
|
16
16
|
|
17
17
|
def deliver
|
@@ -22,6 +22,7 @@ module Nuntius
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def new_message(subscriber, assigns = {})
|
25
|
+
assigns["campaign"] = context.campaign
|
25
26
|
assigns["subscriber"] = subscriber
|
26
27
|
if subscriber.nuntiable
|
27
28
|
name = Nuntius::BaseMessenger.liquid_variable_name_for(subscriber.nuntiable)
|
@@ -29,8 +30,11 @@ module Nuntius
|
|
29
30
|
end
|
30
31
|
message = Nuntius::Message.new(transport: campaign.transport, campaign: campaign, nuntiable: subscriber.nuntiable, metadata: campaign.metadata)
|
31
32
|
|
32
|
-
|
33
|
-
|
33
|
+
locale = nil
|
34
|
+
if subscriber.nuntiable
|
35
|
+
locale_proc = Nuntius::BaseMessenger.messenger_for_obj(subscriber.nuntiable).locale
|
36
|
+
locale = instance_exec(subscriber.nuntiable, &locale_proc) if locale_proc
|
37
|
+
end
|
34
38
|
|
35
39
|
message.from = render(:from, assigns, locale)
|
36
40
|
message.to = case campaign.transport
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Nuntius
|
4
|
+
class CampaignMessagesTable < Nuntius::ApplicationTable
|
5
|
+
definition do
|
6
|
+
model Nuntius::Message
|
7
|
+
|
8
|
+
column(:to)
|
9
|
+
column(:status)
|
10
|
+
column(:created_at)
|
11
|
+
|
12
|
+
order created_at: :desc
|
13
|
+
|
14
|
+
link { |message| nuntius.admin_message_path(message) }
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def scope
|
20
|
+
@scope = Nuntius::Campaign.find_by(params[:campaign_id]).messages
|
21
|
+
@scope
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -27,21 +27,13 @@
|
|
27
27
|
.col-span-12
|
28
28
|
= f.input :subject
|
29
29
|
.col-span-12
|
30
|
-
= f.
|
31
|
-
|
30
|
+
= f.rich_text :html
|
31
|
+
.col-span-12
|
32
|
+
= f.input :metadata_yaml, as: :editor, mode: 'application/yaml', label: t('.metadata')
|
32
33
|
|
33
34
|
template data-toggle-target='toggleable' data-toggle-value='voice'
|
34
35
|
.col-span-12
|
35
36
|
= f.input :text, as: :editor, mode: 'text/plain'
|
36
37
|
- else
|
37
|
-
= sts.card :nuntius_admin_campaigns, title: @campaign.name, description: 'We are sending this campaign, you can no longer make any changes.', icon: 'fal fa-megaphone', content_padding: false do |card|
|
38
|
-
table.
|
39
|
-
thead
|
40
|
-
tr
|
41
|
-
th Status
|
42
|
-
th To
|
43
|
-
tbody
|
44
|
-
- for message in @messages
|
45
|
-
tr
|
46
|
-
td = link_to message.status, admin_message_path(message)
|
47
|
-
td = message.to
|
38
|
+
= sts.card :nuntius_admin_campaigns, title: @campaign.name, description: 'We are sending or have sent this campaign, you can no longer make any changes.', icon: 'fal fa-megaphone', content_padding: false do |card|
|
39
|
+
= sts.table :"nuntius/campaign_messages", params: { campaign_id: @campaign.id }
|
@@ -32,10 +32,11 @@
|
|
32
32
|
= (attachment.blob.byte_size / 1048576.0).round(2)
|
33
33
|
' MB
|
34
34
|
= link_to admin_layout_attachment_path(@layout, attachment.id), data: { controller: 'attachment-delete', 'action': 'attachment-delete#delete' } do
|
35
|
-
i.
|
35
|
+
i.fas.fa-xmark
|
36
36
|
=< link_to(main_app.rails_blob_path(attachment, disposition: 'attachment'),
|
37
37
|
title: attachment.filename)
|
38
|
-
i.
|
38
|
+
i.fas.fa-download
|
39
|
+
code.text-xs = sts.copyable main_app.rails_blob_url(attachment)
|
39
40
|
|
40
41
|
- if @layout.templates.exists?
|
41
42
|
- card.with_tab :templates, padding: false
|
data/config/locales/en.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/lib/nuntius/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nuntius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom de Grunt
|
@@ -497,6 +497,7 @@ files:
|
|
497
497
|
- app/services/nuntius/deliver_inbound_message_service.rb
|
498
498
|
- app/services/nuntius/retrieve_inbound_mail_service.rb
|
499
499
|
- app/tables/nuntius/application_table.rb
|
500
|
+
- app/tables/nuntius/campaign_messages_table.rb
|
500
501
|
- app/tables/nuntius/campaigns_table.rb
|
501
502
|
- app/tables/nuntius/layouts_table.rb
|
502
503
|
- app/tables/nuntius/lists_table.rb
|