Class: Mailbox

Inherits:
MailgunResource show all
Defined in:
lib/mailgun.rb

Overview

All mail arriving to email addresses that have mailboxes associated will be stored on the server and can be later accessed via IMAP or POP3 protocols.

Mailbox has several properties:

[email protected]

^      ^
|      |

user domain

Class Method Summary collapse

Methods inherited from MailgunResource

#upsert

Methods included from Mailgun::RequestBuilder

#prepare_request

Class Method Details

.upsert_from_csv(mailboxes) ⇒ Object

Example of a CSV file:

[email protected], password [email protected], password2



152
153
154
155
156
157
# File 'lib/mailgun.rb', line 152

def self.upsert_from_csv(mailboxes)
  uri_str = "#{MailgunResource.site}mailboxes.txt?api_key=#{MailgunResource.password}"
  http, url = prepare_request(uri_str)
  res = http.post(url, mailboxes, {"Content-type" => "text/plain" })
  Mailgun::handle_response(res)
end