Class: MailEngine::Sendgrid::RestApi
- Inherits:
-
Object
- Object
- MailEngine::Sendgrid::RestApi
- Includes:
- HTTParty
- Defined in:
- lib/mail_engine/sendgrid/rest_api.rb
Class Method Summary collapse
-
.blocks(options = {}) ⇒ Object
<blocks> <block> <email>[email protected]</email> <status></status> <reason>Some random block reason</reason> <created>2010-11-08 20:39:29</created> </block> </blocks>.
-
.bounces(options = {}) ⇒ Object
<bounces> <bounce> <email>[email protected]</email> <status>5.1.1</status> <reason>host [127.0.0.1] said: 550 5.1.1 unknown or illegal user: [email protected]</reason> <created>2009-06-10 12:40:30</created> </bounce> </bounces>.
-
.invalidemails(options = {}) ⇒ Object
<invalidemails> <invalidemail> <email>[email protected]</email> <reason>Mail domain mentioned in email address is unknown</reason> <created>2009-06-10 12:40:30</created> </invalidemail> </invalidemails>.
-
.spamreports(options = {}) ⇒ Object
<spamreports> <spamreport> <email>[email protected]</email> <created>2009-06-10 12:40:30</created> </spamreport> </spamreports>.
-
.stats(options = {}) ⇒ Object
<stats> <day> <date>2009-06-20</date> <requests>12342</requests> <bounces>12</bounces> <clicks>10223</clicks> <opens>9992</opens> <spamreports>5</spamreports> <unique_clicks>3</unique_clicks> <unique_opens>6</unique_opens> <blocked>7</blocked> </day> </stats>.
Class Method Details
.blocks(options = {}) ⇒ Object
<blocks>
<block>
<email>[email protected]</email>
<status></status>
<reason>Some random block reason</reason>
<created>2010-11-08 20:39:29</created>
</block>
</blocks>
78 79 80 81 |
# File 'lib/mail_engine/sendgrid/rest_api.rb', line 78 def blocks = {} response = get "/blocks.get.xml", :query => response["blocks"].try(:send, :[], "block") end |
.bounces(options = {}) ⇒ Object
<bounces>
<bounce>
<email>[email protected]</email>
<status>5.1.1</status>
<reason>host [127.0.0.1] said: 550 5.1.1 unknown or illegal user: [email protected]</reason>
<created>2009-06-10 12:40:30</created>
</bounce>
</bounces>
42 43 44 45 |
# File 'lib/mail_engine/sendgrid/rest_api.rb', line 42 def bounces = {} response = get "/bounces.get.xml", :query => response["bounces"].try(:send, :[], "bounce") end |
.invalidemails(options = {}) ⇒ Object
<invalidemails>
<invalidemail>
<email>[email protected]</email>
<reason>Mail domain mentioned in email address is unknown</reason>
<created>2009-06-10 12:40:30</created>
</invalidemail>
</invalidemails>
65 66 67 68 |
# File 'lib/mail_engine/sendgrid/rest_api.rb', line 65 def invalidemails = {} response = get "/invalidemails.get.xml", :query => response["invalidemails"].try(:send, :[], "invalidemail") end |
.spamreports(options = {}) ⇒ Object
<spamreports>
<spamreport>
<email>[email protected]</email>
<created>2009-06-10 12:40:30</created>
</spamreport>
</spamreports>
53 54 55 56 |
# File 'lib/mail_engine/sendgrid/rest_api.rb', line 53 def spamreports = {} response = get "/spamreports.get.xml", :query => response["spamreports"].try(:send, :[], "spamreport") end |
.stats(options = {}) ⇒ Object
<stats>
<day>
<date>2009-06-20</date>
<requests>12342</requests>
<bounces>12</bounces>
<clicks>10223</clicks>
<opens>9992</opens>
<spamreports>5</spamreports>
<unique_clicks>3</unique_clicks>
<unique_opens>6</unique_opens>
<blocked>7</blocked>
</day>
</stats>
29 30 31 32 |
# File 'lib/mail_engine/sendgrid/rest_api.rb', line 29 def stats = {} response = get "/stats.get.xml", :query => response["stats"].try(:send, :[], "day") end |