mailkube 1.3.0 → 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/lib/mailkube/events/contexts.rb +16 -1
- data/lib/mailkube/events/envelopes.rb +6 -0
- data/lib/mailkube/events/payloads.rb +6 -0
- data/lib/mailkube/events/registry.rb +1 -0
- data/lib/mailkube/version.rb +1 -1
- data/sig/mailkube/events/contexts.rbs +7 -0
- data/sig/mailkube/events/envelopes.rbs +4 -0
- data/sig/mailkube/events/payloads.rbs +4 -0
- 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: 0ea1813dc5b4d117f67bfc8d90ce5b7430d6b8bed26c23b2ce356b095f7436b6
|
|
4
|
+
data.tar.gz: d4438b2e10aa4ca8406992808b6c8c83a15add42e37839f2605adf13d3c20c13
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 87b3cf4a51de54e5544b6d625ed9ba9fa07de87f64b7fedfd6a5d10b9186fb889dbecedc481846d90a4bbfa552a95c320a3960d2287c79b2e783160b40494609
|
|
7
|
+
data.tar.gz: 02a78b3cc86641f963555a4dad65a3e8b2b4a9f4581a5224066bde077aedc5d2a64af9c6096fbdd9f4a310e69a427f160c9be66e05d17c5f4b90abd060385949
|
data/README.md
CHANGED
|
@@ -259,6 +259,7 @@ implement it.
|
|
|
259
259
|
| `email.failed` | `EmailFailedEvent` | `data.failed` |
|
|
260
260
|
| `email.opened` | `EmailOpenedEvent` | `data.open` |
|
|
261
261
|
| `email.clicked` | `EmailClickedEvent` | `data.click` |
|
|
262
|
+
| `email.complained` | `EmailComplainedEvent` | `data.complaint` |
|
|
262
263
|
| `domain.status` | `DomainStatusEvent` | `data.previous` |
|
|
263
264
|
| `webhook.status` | `WebhookStatusEvent` | `data.previous` |
|
|
264
265
|
|
|
@@ -4,7 +4,7 @@ module Mailkube
|
|
|
4
4
|
module Events
|
|
5
5
|
# The message an event is about: the fields every `email.*` event carries.
|
|
6
6
|
#
|
|
7
|
-
# The shared base of all
|
|
7
|
+
# The shared base of all ten `email.*` payloads, mirroring the server, where one serializer
|
|
8
8
|
# supplies this block to every message event.
|
|
9
9
|
#
|
|
10
10
|
# Every field except the id and timestamp is nullable: they are denormalized from the send
|
|
@@ -94,6 +94,21 @@ module Mailkube
|
|
|
94
94
|
def timestamp = self["timestamp"]
|
|
95
95
|
end
|
|
96
96
|
|
|
97
|
+
# The spam complaint behind `email.complained`.
|
|
98
|
+
#
|
|
99
|
+
# `feedback_type` and `provider` are server-controlled strings, never enums: a feedback type
|
|
100
|
+
# added later must not become a parse error on an already-released client.
|
|
101
|
+
class ComplaintContext < Node
|
|
102
|
+
# @return [String] the lowercased address that complained, now suppressed.
|
|
103
|
+
def recipient = self["recipient"]
|
|
104
|
+
# @return [String] when the provider's report arrived.
|
|
105
|
+
def timestamp = self["timestamp"]
|
|
106
|
+
# @return [String] the kind of report, `abuse` today.
|
|
107
|
+
def feedback_type = self["feedback_type"]
|
|
108
|
+
# @return [String] the domain of the feedback loop that sent the report, e.g. `yahoo.com`.
|
|
109
|
+
def provider = self["provider"]
|
|
110
|
+
end
|
|
111
|
+
|
|
97
112
|
# When a scheduled send is due (`email.scheduled`).
|
|
98
113
|
#
|
|
99
114
|
# Unlike the engagement blocks, these keys are snake_case on the wire.
|
|
@@ -71,6 +71,12 @@ module Mailkube
|
|
|
71
71
|
def data = block(ClickedData, "data")
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
+
# A recipient's mailbox provider reported the message as spam; the recipient is now suppressed.
|
|
75
|
+
class EmailComplainedEvent < Event
|
|
76
|
+
# @return [ComplainedData] the event payload.
|
|
77
|
+
def data = block(ComplainedData, "data")
|
|
78
|
+
end
|
|
79
|
+
|
|
74
80
|
# A sending domain's status or onboarding state changed.
|
|
75
81
|
class DomainStatusEvent < Event
|
|
76
82
|
# @return [DomainStatusData] the event payload.
|
|
@@ -56,6 +56,12 @@ module Mailkube
|
|
|
56
56
|
def click = block(ClickContext, "click")
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
# The `data` of `email.complained`: the message, plus the spam complaint.
|
|
60
|
+
class ComplainedData < MessageContext
|
|
61
|
+
# @return [ComplaintContext] the complaint, with its reporting provider.
|
|
62
|
+
def complaint = block(ComplaintContext, "complaint")
|
|
63
|
+
end
|
|
64
|
+
|
|
59
65
|
# The `data` of `domain.status`: a sending domain's new state, and its previous one.
|
|
60
66
|
#
|
|
61
67
|
# Not a {MessageContext}: a domain lifecycle event is about the domain, not about a message.
|
|
@@ -19,6 +19,7 @@ module Mailkube
|
|
|
19
19
|
"email.failed" => EmailFailedEvent,
|
|
20
20
|
"email.opened" => EmailOpenedEvent,
|
|
21
21
|
"email.clicked" => EmailClickedEvent,
|
|
22
|
+
"email.complained" => EmailComplainedEvent,
|
|
22
23
|
"domain.status" => DomainStatusEvent,
|
|
23
24
|
"webhook.status" => WebhookStatusEvent
|
|
24
25
|
}.freeze
|
data/lib/mailkube/version.rb
CHANGED
|
@@ -11,5 +11,5 @@ module Mailkube
|
|
|
11
11
|
# semantic-release rewrites this line **in the release runner** just before the gem is built, and
|
|
12
12
|
# commits nothing back to `main` (see `.rules/RELEASE.md`). So a checkout reports `0.0.0` and an
|
|
13
13
|
# installed gem reports the real version: that is intended, not a bug to fix by hardcoding one.
|
|
14
|
-
VERSION = "1.
|
|
14
|
+
VERSION = "1.4.0"
|
|
15
15
|
end
|
|
@@ -37,6 +37,13 @@ module Mailkube
|
|
|
37
37
|
def timestamp: () -> String
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
+
class ComplaintContext < Node
|
|
41
|
+
def recipient: () -> String
|
|
42
|
+
def timestamp: () -> String
|
|
43
|
+
def feedback_type: () -> String
|
|
44
|
+
def provider: () -> String
|
|
45
|
+
end
|
|
46
|
+
|
|
40
47
|
class ScheduledContext < Node
|
|
41
48
|
def scheduled_at: () -> String
|
|
42
49
|
def batch_id: () -> String?
|