Class: Mailgun::Mailbox
Instance Method Summary collapse
-
#create(mailbox_name, password) ⇒ Object
Creates a mailbox on the Mailgun server with the given password.
-
#destroy(mailbox_name) ⇒ Object
Destroys the mailbox.
-
#initialize(mailgun, domain) ⇒ Mailbox
constructor
Used internally, called from Mailgun::Base.
-
#list(options = {}) ⇒ Object
List all mailboxes for a given domain * domain the domain for which all mailboxes will listed.
-
#update_password(mailbox_name, password) ⇒ Object
Sets the password for a mailbox.
Constructor Details
#initialize(mailgun, domain) ⇒ Mailbox
Used internally, called from Mailgun::Base
5 6 7 8 |
# File 'lib/mailgun/mailbox.rb', line 5 def initialize(mailgun, domain) @mailgun = mailgun @domain = domain end |
Instance Method Details
#create(mailbox_name, password) ⇒ Object
Creates a mailbox on the Mailgun server with the given password
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/mailgun/mailbox.rb', line 18 def create(mailbox_name, password) address = "#{mailbox_name}@#{@domain}" Mailgun.submit( :post, mailbox_url, { :mailbox => address, :password => password } ) end |
#destroy(mailbox_name) ⇒ Object
Destroys the mailbox
38 39 40 |
# File 'lib/mailgun/mailbox.rb', line 38 def destroy(mailbox_name) Mailgun.submit :delete, mailbox_url(mailbox_name) end |