Class: Mandrill::Exports

Inherits:
Object
  • Object
show all
Defined in:
lib/mandrill/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(master) ⇒ Exports



207
208
209
# File 'lib/mandrill/api.rb', line 207

def initialize(master)
    @master = master
end

Instance Attribute Details

#masterObject

Returns the value of attribute master.



205
206
207
# File 'lib/mandrill/api.rb', line 205

def master
  @master
end

Instance Method Details

#activity(notify_email = nil, date_from = nil, date_to = nil, tags = nil, senders = nil, states = nil) ⇒ Hash

Begins an export of your activity history. The activity will be exported to a zip archive containing a single file named activity.csv in the same format as you would be able to export from your account’s activity view. It includes the following fields: Date, Email Address, Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom metadata fields, they will be included in the exported data.



284
285
286
287
# File 'lib/mandrill/api.rb', line 284

def activity(notify_email=nil, date_from=nil, date_to=nil, tags=nil, senders=nil, states=nil)
    _params = {:notify_email => notify_email, :date_from => date_from, :date_to => date_to, :tags => tags, :senders => senders, :states => states}
    return @master.call 'exports/activity', _params
end

#info(id) ⇒ Hash

Returns information about an export job. If the export job’s state is ‘complete’, the returned data will include a URL you can use to fetch the results. Every export job produces a zip archive, but the format of the archive is distinct for each job type. The api calls that initiate exports include more details about the output format for that job type.



220
221
222
223
# File 'lib/mandrill/api.rb', line 220

def info(id)
    _params = {:id => id}
    return @master.call 'exports/info', _params
end

#listArray

Returns a list of your exports.



234
235
236
237
# File 'lib/mandrill/api.rb', line 234

def list()
    _params = {}
    return @master.call 'exports/list', _params
end

#rejects(notify_email = nil) ⇒ Hash

Begins an export of your rejection blacklist. The blacklist will be exported to a zip archive containing a single file named rejects.csv that includes the following fields: email, reason, detail, created_at, expires_at, last_event_at, expires_at.



248
249
250
251
# File 'lib/mandrill/api.rb', line 248

def rejects(notify_email=nil)
    _params = {:notify_email => notify_email}
    return @master.call 'exports/rejects', _params
end

#whitelist(notify_email = nil) ⇒ Hash

Begins an export of your rejection whitelist. The whitelist will be exported to a zip archive containing a single file named whitelist.csv that includes the following fields: email, detail, created_at.



262
263
264
265
# File 'lib/mandrill/api.rb', line 262

def whitelist(notify_email=nil)
    _params = {:notify_email => notify_email}
    return @master.call 'exports/whitelist', _params
end