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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5efd02b82c63ffe38f919d2fa9a5141aa5c7e10a893ddc33ecdf6227d0eb379
4
- data.tar.gz: 6cafb691b11923b959de7be667353c0f410183fa72dcb91fa538a40f5ad2eda9
3
+ metadata.gz: 0ea1813dc5b4d117f67bfc8d90ce5b7430d6b8bed26c23b2ce356b095f7436b6
4
+ data.tar.gz: d4438b2e10aa4ca8406992808b6c8c83a15add42e37839f2605adf13d3c20c13
5
5
  SHA512:
6
- metadata.gz: b2b0bfab25b6a83378b6a943c1493af5ad98fd7046eb4baec3428bb93b4fbf536c376c737058baed3d0cf9a56c722e74809e79c306ee4dcf67d0b774d9b54640
7
- data.tar.gz: c3d57c7e69b2ed05e6ab5472242d5309df53a4e0a33d83f0a473f0bf1f9164abca2c83e9fc4ed6eee936bf3440667adb373a8c8948b766c99ff81b4df9b227eb
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 nine `email.*` payloads, mirroring the server, where one serializer
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
@@ -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.3.0"
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?
@@ -45,6 +45,10 @@ module Mailkube
45
45
  def data: () -> ClickedData
46
46
  end
47
47
 
48
+ class EmailComplainedEvent < Event
49
+ def data: () -> ComplainedData
50
+ end
51
+
48
52
  class DomainStatusEvent < Event
49
53
  def data: () -> DomainStatusData
50
54
  end
@@ -36,6 +36,10 @@ module Mailkube
36
36
  def click: () -> ClickContext
37
37
  end
38
38
 
39
+ class ComplainedData < MessageContext
40
+ def complaint: () -> ComplaintContext
41
+ end
42
+
39
43
  class DomainStatusData < Node
40
44
  def domain: () -> String
41
45
  def status: () -> String
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailkube
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mail Tactic Corporation