nuntius 1.3.20 → 1.4.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 +1 -0
- data/app/jobs/nuntius/messenger_job.rb +3 -1
- data/app/messengers/nuntius/base_messenger.rb +3 -1
- data/lib/nuntius/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96231ee66f145c33c7c1fea7669be34a28d03c4c8f802cee010c984ad97f30c7
|
4
|
+
data.tar.gz: 98c827211fc8a8082710352838744ecb7b646ef4083493eb7078059b1627471b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3c2ba2b4663c73fd4ac849b0a94878646b1f32c743be1c7f1db8f9529934920497abb54345f7d35b56f7cd682ecbc710944f3bd89c9a7444f7878b7967b79d4
|
7
|
+
data.tar.gz: d54a2dd92af1f92cc40886c4be3bdfea123bdcb9f451abca15b919258f010b2363bc404b3f6f0a7c1f78bf1fb417dc65f0328fca12d98e7c38e9f381a44c963d
|
data/README.md
CHANGED
@@ -64,6 +64,7 @@ class CarMessenger < Nuntius::BaseMessenger
|
|
64
64
|
pdf = ApplicationController.renderer.new(http_host: object.account.hostname, https: true).render(template: "commercial_invoice/show", formats: [:pdf], assigns: {order: object})
|
65
65
|
|
66
66
|
attachments << {content: StringIO.new(pdf), content_type: "application/pdf", filename: "commercial_invoice.pdf"}
|
67
|
+
# Return false here if you don't want the message to be sent
|
67
68
|
end
|
68
69
|
end
|
69
70
|
```
|
@@ -9,7 +9,9 @@ module Nuntius
|
|
9
9
|
messenger = Nuntius::BaseMessenger.messenger_for_obj(obj).new(obj, event, params)
|
10
10
|
return unless messenger.is_a?(Nuntius::CustomMessenger) || messenger.respond_to?(event.to_sym)
|
11
11
|
|
12
|
-
messenger.call
|
12
|
+
result = messenger.call
|
13
|
+
return if result == false
|
14
|
+
|
13
15
|
templates = messenger.templates
|
14
16
|
messenger.dispatch(templates) if templates.present?
|
15
17
|
end
|
@@ -22,9 +22,11 @@ module Nuntius
|
|
22
22
|
# Calls the event method on the messenger
|
23
23
|
def call
|
24
24
|
select_templates
|
25
|
+
result = nil
|
25
26
|
run_callbacks(:action) do
|
26
|
-
send(@event.to_sym, @object, @params) if respond_to?(@event.to_sym)
|
27
|
+
result = send(@event.to_sym, @object, @params) if respond_to?(@event.to_sym)
|
27
28
|
end
|
29
|
+
result
|
28
30
|
end
|
29
31
|
|
30
32
|
# Turns the templates in messages, and dispatches the messages to transports
|
data/lib/nuntius/version.rb
CHANGED