Class: EmailEvents::Adapters::Abstract::EventData

Inherits:
Object
  • Object
show all
Defined in:
lib/email_events/adapters/abstract/event_data.rb

Direct Known Subclasses

Sendgrid::EventData, Ses::EventData

Instance Method Summary collapse

Instance Method Details

#simplified_statusObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/email_events/adapters/abstract/event_data.rb', line 9

def simplified_status
  # try to get a specific status based on the smtp status code; however, if the event doesn't have an smtp
  # status code (eg. bounce events always do, but drop events only do sometimes), supply a generic one
  return :unable_to_send_email_to_address_provided if smtp_status_code.blank?

  case smtp_status_code
  when 510, 511, 512
    :email_address_invalid
  when 523
    :email_exceeds_recipients_size_limit
  when 541
    :email_rejected_as_spam
  when 552
    :recipients_inbox_is_full
  else
    :unknown
  end
end