Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.49 KB

Domains.md

File metadata and controls

57 lines (41 loc) · 1.49 KB

Mailgun - Domains

This is the Mailgun Ruby Domain utilities.

The below assumes you've already installed the Mailgun Ruby SDK in to your project. If not, go back to the master README for instructions. It currently supports all calls except credentials.

Usage - Domains

# First, instantiate the Mailgun Client with your API key
mg_client = Mailgun::Client.new('your-api-key')
domainer = Mailgun::Domains.new(mg_client)

# Get a list of current domains.
domainer.list

# View details of a domain
domainer.info 'my.perfect.domain'

# Add a new domain
domainer.create 'my.new.moreness'
# or with options
domainer.create 'my.new.moreness', { some: 'options' }

# Remove a domain
domainer.remove 'this.one.is.not.needed.'

# Update a domain
domainer.update 'my.new.moreness', { some: 'options' }

Suppressions for a Domain

You can manage domain suppressions (bounces, unsubscribes, complaints) using the Mailgun::Suppressions client:

# Instantiate the Mailgun Client with your API key
mg_client = Mailgun::Client.new('your-api-key')
supp_client = mg_client.suppressions('example.org')

# ...

See the Suppressions for usage samples and suppressions.rb for suppressions client API.

More Documentation

See the official Mailgun Domain Docs for more information