lib/howitzer/email.rb in howitzer-1.1.0 vs lib/howitzer/email.rb in howitzer-1.1.1
- old
+ new
@@ -44,11 +44,11 @@
events = Mailgun::Connector.instance.client.get("#{Mailgun::Connector.instance.domain}/events", event: 'stored')
event = events.to_h['items'].find do |hash|
hash['message']['recipients'].first == recipient && hash['message']['headers']['subject'] == subject
end
if event
- message = Mailgun::Connector.instance.client.get("domains/#{Mailgun::Connector.instance.domain}/messages/#{event['storage']['key']}").to_h
+ message = Mailgun::Connector.instance.client.get_url(event['storage']['url']).to_h
else
raise Howitzer::EmailNotFoundError.new('Message not received yet, retry...')
end
end
log.error Howitzer::EmailNotFoundError, "Message with subject '#{subject}' for recipient '#{recipient}' was not found." if message.empty?
@@ -129,6 +129,6 @@
log.error Howitzer::NoAttachmentsError, 'No attachments where found.'
return
end
files
end
-end
\ No newline at end of file
+end