Class: Mailtrap::SendingDomainsAPI
- Inherits:
-
Object
- Object
- Mailtrap::SendingDomainsAPI
- Includes:
- BaseAPI
- Defined in:
- lib/mailtrap/sending_domains_api.rb
Instance Attribute Summary
Attributes included from BaseAPI
Instance Method Summary collapse
-
#create(options) ⇒ SendingDomain
Creates a new sending domain.
-
#delete(domain_id) ⇒ Object
Deletes a sending domain.
-
#get(domain_id) ⇒ SendingDomain
Retrieves a specific sending domain.
-
#list ⇒ Array<SendingDomain>
Lists all sending domains for the account.
-
#send_setup_instructions(domain_id, email:) ⇒ Object
Email DNS configuration instructions for the sending domain.
-
#update(domain_id, options) ⇒ SendingDomain
Updates configuration settings for a sending domain.
Methods included from BaseAPI
Instance Method Details
#create(options) ⇒ SendingDomain
Creates a new sending domain
42 43 44 |
# File 'lib/mailtrap/sending_domains_api.rb', line 42 def create() base_create(, %i[domain_name]) end |
#delete(domain_id) ⇒ Object
Deletes a sending domain
50 51 52 |
# File 'lib/mailtrap/sending_domains_api.rb', line 50 def delete(domain_id) base_delete(domain_id) end |
#get(domain_id) ⇒ SendingDomain
Retrieves a specific sending domain
32 33 34 |
# File 'lib/mailtrap/sending_domains_api.rb', line 32 def get(domain_id) base_get(domain_id) end |
#list ⇒ Array<SendingDomain>
Lists all sending domains for the account
23 24 25 26 |
# File 'lib/mailtrap/sending_domains_api.rb', line 23 def list response = client.get(base_path) response[:data].map { |item| handle_response(item) } end |
#send_setup_instructions(domain_id, email:) ⇒ Object
Email DNS configuration instructions for the sending domain
74 75 76 |
# File 'lib/mailtrap/sending_domains_api.rb', line 74 def send_setup_instructions(domain_id, email:) client.post("#{base_path}/#{domain_id}/send_setup_instructions", email:) end |
#update(domain_id, options) ⇒ SendingDomain
Updates configuration settings for a sending domain
65 66 67 |
# File 'lib/mailtrap/sending_domains_api.rb', line 65 def update(domain_id, ) base_update(domain_id, ) end |