ses_blacklist_rails 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee9576ef3f25682c6b2cb90f67a155c860863284
|
4
|
+
data.tar.gz: 3bf58fb824e3ad9d6b1f003a11e6666b8166768a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8b175376266110ac9b4616a8f030f2bdb77b85a52a382c9f2d3ec02f055ea24d4cc805a46e7a4a74c1671b1ed78410df176307f7bdbe548eb5785daad5af3c1
|
7
|
+
data.tar.gz: de49fe1fe1fcd8dc986e95a08b7b1ed34832137d8484b89322957704e5ef8453b8baa7947fe0f7d511a1a307a5d39f0d91311965506fb1238b3c16b2a1116885
|
@@ -7,18 +7,30 @@ module SesBlacklistRails
|
|
7
7
|
before_action :parse_request
|
8
8
|
|
9
9
|
def index
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
if @params[:Type] == 'SubscriptionConfirmation'
|
11
|
+
create_notification('', :other)
|
12
|
+
begin
|
13
|
+
uri = URI.parse @params[:SubscribeURL]
|
14
|
+
res = Net::HTTP.get_response uri
|
15
|
+
return render plain: '', status: 500 if res.code.to_i != 200
|
16
|
+
rescue StandardError
|
17
|
+
return render plain: '', status: 500
|
14
18
|
end
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
|
20
|
+
else
|
21
|
+
case @params[:notificationType]
|
22
|
+
when 'Bounce'
|
23
|
+
@params[:bounce][:bouncedRecipients].each do |r|
|
24
|
+
create_notification(r, :bounce)
|
25
|
+
end
|
26
|
+
when 'Complaint'
|
27
|
+
@params[:complaint][:complainedRecipients].each do |r|
|
28
|
+
create_notification(r, :complaint)
|
29
|
+
end
|
30
|
+
when 'Delivery'
|
31
|
+
@params[:delivery][:recipients].each do |r|
|
32
|
+
create_notification(r, :delivery)
|
33
|
+
end
|
22
34
|
end
|
23
35
|
end
|
24
36
|
end
|
@@ -32,7 +44,7 @@ module SesBlacklistRails
|
|
32
44
|
def create_notification(recipient, type)
|
33
45
|
Notification.create(
|
34
46
|
notification_type: Notification.notification_types[type],
|
35
|
-
email:
|
47
|
+
email: %i[delivery other].include?(type) ? recipient : recipient[:emailAddress],
|
36
48
|
log: @params
|
37
49
|
)
|
38
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ses_blacklist_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mrdShinse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|