Class: Mailkube::Events::MessageContext
- Defined in:
- lib/mailkube/events/contexts.rb,
sig/mailkube/events/contexts.rbs
Overview
The message an event is about: the fields every email.* event carries.
The shared base of all nine email.* payloads, mirroring the server, where one serializer
supplies this block to every message event.
Every field except the id and timestamp is nullable: they are denormalized from the send transaction, and there is a window in which an event can be emitted before that row exists.
Direct Known Subclasses
BouncedData, ClickedData, DelayedData, DeliveredData, FailedData, OpenedData, ScheduledData, SentData, SuppressedData
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#created_at ⇒ String
When the message was accepted.
-
#domain ⇒ String?
The sending domain.
-
#email_id ⇒ String
The message's UUID.
-
#from ⇒ String?
fromis the wire key and is neither a Ruby keyword nor an Object method, so it needs no renaming — unlike Python, wherefrom_is forced. -
#subject ⇒ String?
The subject line.
-
#tags ⇒ Array[Hash[String, untyped]]
Plain hashes, not
Mailkube::Tag: aDatawould drop an unknown key inside a tag. -
#to ⇒ Array<String>?
The recipients.
Methods inherited from Node
#==, #[], #block, #hash, #initialize, #to_h
Constructor Details
This class inherits a constructor from Mailkube::Events::Node
Instance Method Details
#created_at ⇒ String
Returns when the message was accepted.
16 17 |
# File 'lib/mailkube/events/contexts.rb', line 16 def created_at = self["created_at"] # @return [String, nil] the sending domain. |
#domain ⇒ String?
Returns the sending domain.
18 19 |
# File 'lib/mailkube/events/contexts.rb', line 18 def domain = self["domain"] # @return [String, nil] the subject line. |
#email_id ⇒ String
Returns the message's UUID.
14 15 |
# File 'lib/mailkube/events/contexts.rb', line 14 def email_id = self["email_id"] # @return [String] when the message was accepted. |
#from ⇒ String?
from is the wire key and is neither a Ruby keyword nor an Object method, so it needs no
renaming — unlike Python, where from_ is forced.
26 |
# File 'lib/mailkube/events/contexts.rb', line 26 def from = self["from"] |
#subject ⇒ String?
Returns the subject line.
20 21 |
# File 'lib/mailkube/events/contexts.rb', line 20 def subject = self["subject"] # @return [Array<String>, nil] the recipients. |
#tags ⇒ Array[Hash[String, untyped]]
Plain hashes, not Mailkube::Tag: a Data would drop an unknown key inside a tag.
37 |
# File 'lib/mailkube/events/contexts.rb', line 37 def = self["tags"] || [] |
#to ⇒ Array<String>?
Returns the recipients.
22 23 24 25 |
# File 'lib/mailkube/events/contexts.rb', line 22 def to = self["to"] # `from` is the wire key and is neither a Ruby keyword nor an Object method, so it needs no # renaming — unlike Python, where `from_` is forced. # @return [String, nil] the sender address. |