Module: Millionsend::Suppressions

Defined in:
lib/millionsend/suppressions.rb

Overview

Suppression list — addresses the API refuses to send to. Entries are addressable by id or by email.

Defined Under Namespace

Modules: Batch

Class Method Summary collapse

Class Method Details

.add(params) ⇒ Object Also known as: create

POST /suppressions — email, origin ("manual" default, "bounce", "complaint", "unsubscribe"). Adding an already suppressed address returns the existing entry.



11
12
13
# File 'lib/millionsend/suppressions.rb', line 11

def add(params)
  Millionsend::Request.new(method: :post, path: "/suppressions", body: params).perform
end

.get(id_or_email) ⇒ Object

GET /suppressions/:id_or_email



23
24
25
# File 'lib/millionsend/suppressions.rb', line 23

def get(id_or_email)
  Millionsend::Request.new(method: :get, path: member_path(id_or_email)).perform
end

.list(options = {}) ⇒ Object

GET /suppressions — accepts limit:/after:/before: and origin:.



17
18
19
20
# File 'lib/millionsend/suppressions.rb', line 17

def list(options = {})
  query = Millionsend::Util.list_query(options).merge(origin: options[:origin])
  Millionsend::Request.new(method: :get, path: "/suppressions", query: query).perform
end

.remove(id_or_email) ⇒ Object

DELETE /suppressions/:id_or_email — allows sending to that address again.



28
29
30
# File 'lib/millionsend/suppressions.rb', line 28

def remove(id_or_email)
  Millionsend::Request.new(method: :delete, path: member_path(id_or_email)).perform
end