istox 0.1.116 → 0.1.117
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/istox/helpers/bunny_boot.rb +2 -0
- data/lib/istox/helpers/messaging.rb +16 -4
- data/lib/istox/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: 4634f2ed68bcfd2d9cadd13f7cf7abf058cddbe6e62ab93870aad18a88d53ac2
|
4
|
+
data.tar.gz: 62ed8c4add8ede254bb43ebc106ac065c28bf4511580c77877838a7126608364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91efe33a64efaa55e2ee02dc418aed1d314ef63aaea7ea3e901457e90da0621b8eb6d1722e1089f417b24a6530ac938fc22d347118aa9974547991aed26a1ab5
|
7
|
+
data.tar.gz: 56c01ec415f4cf928fa4c4f4072b3b8f2081d4be5efa089b6f309d8b26b9fae0e561951aa83761f448f2d65b86371225ba3f481d43fc357ee7b3a8c96a0eadce
|
@@ -83,6 +83,8 @@ module Istox
|
|
83
83
|
manual_ack = queue_config['manual_ack'].nil? ? true : queue_config['manual_ack']
|
84
84
|
|
85
85
|
queue.subscribe manual_ack: manual_ack do |delivery_info, metadata, payload|
|
86
|
+
log.info "Received message in consumer: #{klass}, raw payload: #{payload.inspect}"
|
87
|
+
|
86
88
|
processing_paylod = JSON.parse(payload)
|
87
89
|
payload_object = ::Istox::CommonHelper.to_open_struct(processing_paylod)
|
88
90
|
|
@@ -55,7 +55,12 @@ module Istox
|
|
55
55
|
end
|
56
56
|
|
57
57
|
# email, email can be an array of multiple emails or just string of single email address
|
58
|
-
|
58
|
+
# sample attachments data
|
59
|
+
# [{
|
60
|
+
# fileName: "filename.pdf",
|
61
|
+
# base64: "<Base64 of the file>"
|
62
|
+
# }]
|
63
|
+
def email(emails, subject:, content:, attachments: nil)
|
59
64
|
targets = []
|
60
65
|
if emails.is_a?(Array)
|
61
66
|
targets = emails
|
@@ -77,7 +82,8 @@ module Istox
|
|
77
82
|
data: {
|
78
83
|
to: targets,
|
79
84
|
subject: subject,
|
80
|
-
body: content
|
85
|
+
body: content,
|
86
|
+
attachments: attachments
|
81
87
|
}
|
82
88
|
}
|
83
89
|
)
|
@@ -89,7 +95,12 @@ module Istox
|
|
89
95
|
# istoxP1: auth.first_name,
|
90
96
|
# <more other sample template attributes>: <other sample template data>,
|
91
97
|
# }]
|
92
|
-
|
98
|
+
# sample attachments data
|
99
|
+
# [{
|
100
|
+
# fileName: "filename.zip",
|
101
|
+
# base64: "<Base64 of the file>"
|
102
|
+
# }]
|
103
|
+
def email_template(template_name, template_data_arr, attachments: nil)
|
93
104
|
raise ArgumentError, 'Template name and template data arr cannot be empty' if template_name.blank? || template_data_arr.nil? ||
|
94
105
|
template_data_arr.empty?
|
95
106
|
|
@@ -101,7 +112,8 @@ module Istox
|
|
101
112
|
type: 'SEND_EMAIL_TEMPLATE',
|
102
113
|
data: {
|
103
114
|
template_name: template_name,
|
104
|
-
template_data_arr: template_data_arr
|
115
|
+
template_data_arr: template_data_arr,
|
116
|
+
attachments: attachments
|
105
117
|
}
|
106
118
|
}
|
107
119
|
)
|
data/lib/istox/version.rb
CHANGED