Class: Mailkube::Events::FailureContext

Inherits:
DeliveryContext show all
Defined in:
lib/mailkube/events/contexts.rb,
sig/mailkube/events/contexts.rbs

Overview

A delivery failure, carrying the receiving server's verdict.

Subclasses DeliveryContext because it mirrors the server's own serializer inheritance: a failure is a delivery outcome plus a reason.

Instance Attribute Summary

Attributes inherited from Node

#raw

Instance Method Summary collapse

Methods inherited from DeliveryContext

#recipient, #timestamp

Methods inherited from Node

#==, #[], #block, #hash, #initialize, #to_h

Constructor Details

This class inherits a constructor from Mailkube::Events::Node

Instance Method Details

#codeInteger

Returns the SMTP status code the receiving server returned.

Returns:

  • (Integer)

    the SMTP status code the receiving server returned.



54
55
56
57
# File 'lib/mailkube/events/contexts.rb', line 54

def code = self["code"]
# Server-controlled, and deliberately a plain String: a closed set would turn a reason added
# later into a parse error on an already-released client.
# @return [String] the failure reason.

#reasonString

Server-controlled, and deliberately a plain String: a closed set would turn a reason added later into a parse error on an already-released client.

Returns:

  • (String)

    the failure reason.



58
# File 'lib/mailkube/events/contexts.rb', line 58

def reason = self["reason"]