Class: Mailkube::Events::EngagementContext
- Defined in:
- lib/mailkube/events/contexts.rb,
sig/mailkube/events/contexts.rbs
Overview
An open interaction (email.opened).
These nested keys are camelCase on the wire, unlike every other block here. The SDK mirrors the server rather than normalizing it.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#country ⇒ String?
Elected together with #ip_address, but can still be nil when the address was recorded: it is resolved at the edge and is not available on every path.
-
#ip_address ⇒ String?
The three connection accessors return nil unless the sending domain elected to record the field, which is off by default.
-
#timestamp ⇒ String
When the interaction was recorded.
-
#user_agent ⇒ String?
The opening client's user agent (wire key
userAgent).
Methods inherited from Node
#==, #[], #block, #hash, #initialize, #to_h
Constructor Details
This class inherits a constructor from Mailkube::Events::Node
Instance Method Details
#country ⇒ String?
Elected together with #ip_address, but can still be nil when the address was recorded: it is resolved at the edge and is not available on every path.
78 79 |
# File 'lib/mailkube/events/contexts.rb', line 78 def country = self["country"] # @return [String] when the interaction was recorded. |
#ip_address ⇒ String?
The three connection accessors return nil unless the sending domain elected to record the field, which is off by default. The server omits the key rather than sending a blank, so nil here means "the sender did not record this" and never "the sender recorded an empty value".
72 73 |
# File 'lib/mailkube/events/contexts.rb', line 72 def ip_address = self["ipAddress"] # @return [String, nil] the opening client's user agent (wire key `userAgent`). |
#timestamp ⇒ String
Returns when the interaction was recorded.
80 |
# File 'lib/mailkube/events/contexts.rb', line 80 def = self["timestamp"] |
#user_agent ⇒ String?
Returns the opening client's user agent (wire key userAgent).
74 75 76 77 |
# File 'lib/mailkube/events/contexts.rb', line 74 def user_agent = self["userAgent"] # Elected together with {#ip_address}, but can still be nil when the address was recorded: # it is resolved at the edge and is not available on every path. # @return [String, nil] the two-letter country the address resolves to. |