Class: EmailEvents::Service::ParseSmtpResponseForProviderId

Inherits:
EmailEvents::Service show all
Defined in:
lib/email_events/services/parse_smtp_response_for_provider_id.rb

Instance Method Summary collapse

Methods inherited from EmailEvents::Service

call

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
# File 'lib/email_events/services/parse_smtp_response_for_provider_id.rb', line 7

def call
  # parse the response using the applicable SmtpResponse adapter
  provider_id = parsed_response.provider_message_id
  return if provider_id.nil?

  # find our SentEmailData from our own UUID and store the provider id
  sent_email_data = sent_email_data_class.find_by_uuid(message_uuid)
  sent_email_data.update_attribute(:provider_message_id, provider_id)
end