Module: Mailblastr::Domains
- Defined in:
- lib/mailblastr/domains.rb
Class Method Summary collapse
-
.apply_cloudflare_dns(domain_id, params) ⇒ Object
Apply DNS records via the Cloudflare API, then auto-verify.
-
.apply_godaddy_dns(domain_id, params) ⇒ Object
Apply DNS records via the GoDaddy API, then auto-verify.
-
.apply_namecheap_dns(domain_id, params) ⇒ Object
Apply DNS records via the Namecheap API (existing records preserved), then auto-verify.
-
.claim(params) ⇒ Object
Claim a domain already verified in another account.
-
.create(params) ⇒ Object
Register a sending domain.
-
.delete(domain_id) ⇒ Object
DELETE /domains/:id.
-
.detect_dns(domain_id) ⇒ Object
Detect the DNS provider and available one-click apply methods.
-
.get(domain_id) ⇒ Object
GET /domains/:id.
-
.get_claim(domain_id) ⇒ Object
Retrieve a domain's claim record.
-
.list(params = {}) ⇒ Object
GET /domains.
-
.update(domain_id, params) ⇒ Object
PATCH /domains/:id (returns the slim ack { object: "domain", id }).
-
.verify(domain_id) ⇒ Object
Trigger DNS verification.
-
.verify_claim(domain_id) ⇒ Object
Verify a domain claim's TXT record.
Class Method Details
.apply_cloudflare_dns(domain_id, params) ⇒ Object
Apply DNS records via the Cloudflare API, then auto-verify. POST /domains/:id/dns/cloudflare — params: { token: "..." }
54 55 56 |
# File 'lib/mailblastr/domains.rb', line 54 def apply_cloudflare_dns(domain_id, params) Client.request(:post, "/domains/#{Client.path_escape(domain_id)}/dns/cloudflare", body: params) end |
.apply_godaddy_dns(domain_id, params) ⇒ Object
Apply DNS records via the GoDaddy API, then auto-verify. POST /domains/:id/dns/godaddy — params: { key: "...", secret: "..." }
60 61 62 |
# File 'lib/mailblastr/domains.rb', line 60 def apply_godaddy_dns(domain_id, params) Client.request(:post, "/domains/#{Client.path_escape(domain_id)}/dns/godaddy", body: params) end |
.apply_namecheap_dns(domain_id, params) ⇒ Object
Apply DNS records via the Namecheap API (existing records preserved), then auto-verify. POST /domains/:id/dns/namecheap params: { api_user: "...", api_key: "...", user_name: "..." } — note the backend expects camelCase keys (apiUser/apiKey/userName), so pass those.
68 69 70 |
# File 'lib/mailblastr/domains.rb', line 68 def apply_namecheap_dns(domain_id, params) Client.request(:post, "/domains/#{Client.path_escape(domain_id)}/dns/namecheap", body: params) end |
.claim(params) ⇒ Object
Claim a domain already verified in another account. POST /domains/claim
32 33 34 |
# File 'lib/mailblastr/domains.rb', line 32 def claim(params) Client.request(:post, "/domains/claim", body: params) end |
.create(params) ⇒ Object
Register a sending domain. POST /domains
7 8 9 |
# File 'lib/mailblastr/domains.rb', line 7 def create(params) Client.request(:post, "/domains", body: params) end |
.delete(domain_id) ⇒ Object
DELETE /domains/:id
73 74 75 |
# File 'lib/mailblastr/domains.rb', line 73 def delete(domain_id) Client.request(:delete, "/domains/#{Client.path_escape(domain_id)}") end |
.detect_dns(domain_id) ⇒ Object
Detect the DNS provider and available one-click apply methods. GET /domains/:id/dns/detect
48 49 50 |
# File 'lib/mailblastr/domains.rb', line 48 def detect_dns(domain_id) Client.request(:get, "/domains/#{Client.path_escape(domain_id)}/dns/detect") end |
.get(domain_id) ⇒ Object
GET /domains/:id
12 13 14 |
# File 'lib/mailblastr/domains.rb', line 12 def get(domain_id) Client.request(:get, "/domains/#{Client.path_escape(domain_id)}") end |
.get_claim(domain_id) ⇒ Object
Retrieve a domain's claim record. GET /domains/:id/claim
37 38 39 |
# File 'lib/mailblastr/domains.rb', line 37 def get_claim(domain_id) Client.request(:get, "/domains/#{Client.path_escape(domain_id)}/claim") end |
.list(params = {}) ⇒ Object
GET /domains
17 18 19 |
# File 'lib/mailblastr/domains.rb', line 17 def list(params = {}) Client.request(:get, "/domains", query: Client.pagination(params)) end |
.update(domain_id, params) ⇒ Object
PATCH /domains/:id (returns the slim ack { object: "domain", id }).
22 23 24 |
# File 'lib/mailblastr/domains.rb', line 22 def update(domain_id, params) Client.request(:patch, "/domains/#{Client.path_escape(domain_id)}", body: params) end |
.verify(domain_id) ⇒ Object
Trigger DNS verification. POST /domains/:id/verify
27 28 29 |
# File 'lib/mailblastr/domains.rb', line 27 def verify(domain_id) Client.request(:post, "/domains/#{Client.path_escape(domain_id)}/verify") end |
.verify_claim(domain_id) ⇒ Object
Verify a domain claim's TXT record. POST /domains/:id/claim/verify
42 43 44 |
# File 'lib/mailblastr/domains.rb', line 42 def verify_claim(domain_id) Client.request(:post, "/domains/#{Client.path_escape(domain_id)}/claim/verify") end |