Class: MailEngine::Sendgrid::RestApi

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/mail_engine/sendgrid/rest_api.rb

Class Method Summary collapse

Class Method Details

.blocks(options = {}) ⇒ Object

[email protected] Some random block reason 2010-11-08 20:39:29


78
79
80
81
# File 'lib/mail_engine/sendgrid/rest_api.rb', line 78

def blocks options = {}
  response = get "/blocks.get.xml", :query => options
  response["blocks"].try(:send, :[], "block")
end

.bounces(options = {}) ⇒ Object

[email protected] 5.1.1 host [127.0.0.1] said: 550 5.1.1 unknown or illegal user: [email protected] 2009-06-10 12:40:30


42
43
44
45
# File 'lib/mail_engine/sendgrid/rest_api.rb', line 42

def bounces options = {}
  response = get "/bounces.get.xml", :query => options
  response["bounces"].try(:send, :[], "bounce")
end

.invalidemails(options = {}) ⇒ Object

[email protected] Mail domain mentioned in email address is unknown 2009-06-10 12:40:30


65
66
67
68
# File 'lib/mail_engine/sendgrid/rest_api.rb', line 65

def invalidemails options = {}
  response = get "/invalidemails.get.xml", :query => options
  response["invalidemails"].try(:send, :[], "invalidemail")
end

.spamreports(options = {}) ⇒ Object

[email protected] 2009-06-10 12:40:30


53
54
55
56
# File 'lib/mail_engine/sendgrid/rest_api.rb', line 53

def spamreports options = {}
  response = get "/spamreports.get.xml", :query => options
  response["spamreports"].try(:send, :[], "spamreport")
end

.stats(options = {}) ⇒ Object

2009-06-20 12342 12 10223 9992 5 3 6 7


29
30
31
32
# File 'lib/mail_engine/sendgrid/rest_api.rb', line 29

def stats options = {}
  response = get "/stats.get.xml", :query => options
  response["stats"].try(:send, :[], "day")
end