wbase 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/app/services/wbase/mail_event_batch.rb +19 -18
- data/lib/wbase/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97bc7941a0f62a48ec62f39d74f6cf7eef095791
|
4
|
+
data.tar.gz: 44810f722383e6df294bf660b15982a5a986634d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a0173bf9a1a02c9cc04ed835889e2b002744c8fa735aa15e38366f1a8eda1f640bc17272efc9b0222377814a3ce59135a64ee3c1f1ef2c3f0e1d87b5990208
|
7
|
+
data.tar.gz: cefb0aaaf550be8903cf70cdb5dda455fa115dfc996d72a8689879903cf3a275843292f5d7f1404e4df35e56b5b10b01fc155b2f984529a00c68ef26df93f4e4
|
data/README.md
CHANGED
@@ -218,3 +218,11 @@ if Rails.env.development?
|
|
218
218
|
end
|
219
219
|
mount Wbase::Engine => '/', as: 'wbase'
|
220
220
|
```
|
221
|
+
|
222
|
+
|
223
|
+
Sendgrid settings:
|
224
|
+
|
225
|
+
1. Go to https://app.sendgrid.com/settings/mail_settings
|
226
|
+
2. Turn on Event Notification
|
227
|
+
3. Set HTTP POST URL to `https://www.domain.com/mail_events`
|
228
|
+
|
@@ -1,22 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module Wbase
|
2
|
+
class MailEventBatch
|
3
|
+
def initialize(params)
|
4
|
+
@params = params
|
5
|
+
end
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
7
|
+
def save
|
8
|
+
@params["_json"].each do |ev|
|
9
|
+
ev.permit!
|
10
|
+
Wbase::MailEvent.create(
|
11
|
+
email: ev[:email],
|
12
|
+
sg_message_id: ev[:sg_message_id],
|
13
|
+
timestamp: ev[:timestamp],
|
14
|
+
smtp_id: ev['smtp-id'],
|
15
|
+
event: ev[:event],
|
16
|
+
mail_eventable_id: ev.fetch(:mail_eventable_id, nil),
|
17
|
+
mail_eventable_type: ev.fetch(:mail_eventable_type, nil),
|
18
|
+
data: ev.to_json
|
19
|
+
)
|
20
|
+
end
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
22
|
-
|
data/lib/wbase/version.rb
CHANGED