pager_tree-integrations 1.1.5 → 1.1.6
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 42e8ce6133c42b2f55fe684aa15e588e032ba1a36957a6b96e323775bc34bb16
|
|
4
|
+
data.tar.gz: 6c0d6a23f3d4bc57c39e07e6eced049d8f7c54ff8fc6171d273abcc221438d17
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff070b2a45a5d78a5542a91784e6e8411bd8670f213a669febcde1057e84c1fab92e48f335ff05a839b68f7a94133d27d967bd902c64cd308efc727608e118dd
|
|
7
|
+
data.tar.gz: 3a02d1d7458a527c93c1095c0b4eb64697d1c24bcaf3563b2f0ed1bf4fa5fb3d92e5712a182d6d69072ec8587ed89cd2677053f3f7ab2a44c46cdff07f1faa0e
|
|
@@ -83,7 +83,7 @@ module PagerTree::Integrations
|
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
def validate_record_emails
|
|
86
|
-
errors.add(:record_emails, "must be a valid email") if option_record_emails.any? { |x| !x.match(URI::MailTo::EMAIL_REGEXP) }
|
|
86
|
+
errors.add(:record_emails, "must be a valid email") if option_record_emails.any? { |x| !(x.match(URI::MailTo::EMAIL_REGEXP) || ["team", "team-admin", "on-call"].include?(x)) }
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
def adapter_supports_incoming?
|
|
@@ -229,8 +229,24 @@ module PagerTree::Integrations
|
|
|
229
229
|
|
|
230
230
|
adapter_alert.logs.create!(message: "Caller left a <a href='#{recording_url}' target='_blank'>voicemail</a>.")
|
|
231
231
|
|
|
232
|
-
option_record_emails.
|
|
233
|
-
|
|
232
|
+
if option_record_emails.any?
|
|
233
|
+
emails = option_record_emails.map do |x|
|
|
234
|
+
if x == "team"
|
|
235
|
+
Array(adapter_alert.destination_teams.map(&:admin_users).flatten&.map(&:email)) + Array(adapter_alert.destination_teams.map(&:member_users).flatten&.map(&:email))
|
|
236
|
+
elsif x == "team-admin"
|
|
237
|
+
Array(adapter_alert.destination_teams.map(&:admin_users).flatten&.map(&:email))
|
|
238
|
+
elsif x == "on-call"
|
|
239
|
+
adapter_alert.destination_teams.map do |t|
|
|
240
|
+
Array(t.schedule.current_oncall_event_occurrences.map(&:attendees).flatten.map(&:attendee).uniq.map(&:email))
|
|
241
|
+
end
|
|
242
|
+
else
|
|
243
|
+
x
|
|
244
|
+
end
|
|
245
|
+
end.flatten.compact_blank.uniq
|
|
246
|
+
|
|
247
|
+
emails.each do |email|
|
|
248
|
+
LiveCallRouting::Twilio::V3Mailer.with(email: email, alert: adapter_alert, from: adapter_incoming_request_params.dig("From"), recording_url: recording_url).call_recording.deliver_later
|
|
249
|
+
end
|
|
234
250
|
end
|
|
235
251
|
elsif option_record
|
|
236
252
|
_twiml.play(url: option_no_answer_media_url)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pager_tree-integrations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Austin Miller
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-10-
|
|
11
|
+
date: 2022-10-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|