class SimpleSpark::Endpoints::SendingDomains

Provides access to the /sending-domains endpoint @note Example sending domain

{ "domain": "example1.com", "tracking_domain": "click.example1.com",
"status": { "ownership_verified": true, "spf_status": "valid", "abuse_at_status": "valid",
"abuse_at_status": "valid", "dkim_status": "valid", "compliance_status": "valid", "postmaster_at_status": "valid" } }

@note See: developers.sparkpost.com/api/#/reference/sending-domains

Attributes

client[RW]

Public Class Methods

new(client) click to toggle source
# File lib/simple_spark/endpoints/sending_domains.rb, line 12
def initialize(client)
  @client = client
end

Public Instance Methods

create(values) click to toggle source

Create a sending domain @param domain_name [String] the domain name to create @param tracking_domain [String] the domain name to track this domain against @note See: developers.sparkpost.com/api/#/reference/sending-domains/create-and-list

# File lib/simple_spark/endpoints/sending_domains.rb, line 27
def create(values)
  @client.call(method: :post, path: 'sending-domains', body_values: values)
end
delete(domain_name) click to toggle source

Delete a sending domain @param domain_name [String] the domain name to delete @note See: developers.sparkpost.com/api/#/reference/sending-domains/retrieve-update-and-delete

# File lib/simple_spark/endpoints/sending_domains.rb, line 68
def delete(domain_name)
  domain_name = @client.url_encode(domain_name)
  @client.call(method: :delete, path: "sending-domains/#{domain_name}")
end
list() click to toggle source

Lists your sending domains @return [Array] a list of Sending Domain hash objects @note See: developers.sparkpost.com/api/#/reference/sending-domains/create-and-list/list-all-sending-domains

# File lib/simple_spark/endpoints/sending_domains.rb, line 19
def list
  @client.call(method: :get, path: 'sending-domains')
end
retrieve(domain_name) click to toggle source

Retrieve a sending domain @param domain_name [String] the domain name to retrieve @return [Hash] an Sending Domain hash object @note See: developers.sparkpost.com/api/#/reference/sending-domains/retrieve-update-and-delete

# File lib/simple_spark/endpoints/sending_domains.rb, line 35
def retrieve(domain_name)
  domain_name = @client.url_encode(domain_name)
  @client.call(method: :get, path: "sending-domains/#{domain_name}")
end
update(domain_name, values) click to toggle source

Update a Sending Domain by its domain name @param domain_name [String] the domain to update @param values [Hash] the values to update the sending domain with

@note See: developers.sparkpost.com/api/#/reference/sending-domains/retrieve-update-and-delete

# File lib/simple_spark/endpoints/sending_domains.rb, line 45
def update(domain_name, values)
  domain_name = @client.url_encode(domain_name)
  @client.call(method: :put, path: "sending-domains/#{domain_name}", body_values: values)
end
verify(domain_name, values) click to toggle source

Verify a Sending Domain by its domain name @param domain_name [String] the domain to verify @param values [Hash] the values specifying how to verify the domain

Including the fields "dkim_verify" and/or "spf_verify" in the request initiates a check against the associated DNS record
type for the specified sending domain.Including the fields "postmaster_at_verify" and/or "abuse_at_verify" in the request
results in an email sent to the specified sending domain's postmaster@ and/or abuse@ mailbox where a verification link can
be clicked.Including the fields "postmaster_at_token" and/or "abuse_at_token" in the request initiates a check of the provided
token(s) against the stored token(s) for the specified sending domain.

@note See: developers.sparkpost.com/api/#/reference/sending-domains/verify

# File lib/simple_spark/endpoints/sending_domains.rb, line 60
def verify(domain_name, values)
  domain_name = @client.url_encode(domain_name)
  @client.call(method: :post, path: "sending-domains/#{domain_name}/verify", body_values: values)
end