class SimpleSpark::Endpoints::SuppressionList

Provides access to the /suppression-list endpoint @note Example suppression list recipient

{ "recipient": "rcpt_1@example.com", "transactional": true,
"description": "User requested to not receive any transactional emails." }

@note See: developers.sparkpost.com/api/suppression-list

Attributes

client[RW]

Public Class Methods

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

Public Instance Methods

create_or_update(recipients) click to toggle source

Insert or Update List Entries @param recipients [Array] the entries to insert or update @note See: developers.sparkpost.com/api/suppression-list#suppression-list-bulk-insert-update-put

# File lib/simple_spark/endpoints/suppression_list.rb, line 26
def create_or_update(recipients)
  @client.call(method: :put, path: 'suppression-list', body_values: {recipients: recipients})
end
delete(recipient_email) click to toggle source

Delete a List Entry @param recipient_email [String] the recipient email to delete @note See: developers.sparkpost.com/api/suppression-list#suppression-list-retrieve,-delete-delete

# File lib/simple_spark/endpoints/suppression_list.rb, line 42
def delete(recipient_email)
  recipient_email = @client.url_encode(recipient_email)
  @client.call(method: :delete, path: "suppression-list/#{recipient_email}")
end
retrieve(recipient_email) click to toggle source

Retrieve a Recipient Suppression Status @param recipient_email [String] the recipient email to retrieve @return [Hash] a suppression status result hash object @note See: developers.sparkpost.com/api/suppression-list#suppression-list-retrieve,-delete-get

# File lib/simple_spark/endpoints/suppression_list.rb, line 34
def retrieve(recipient_email)
  recipient_email = @client.url_encode(recipient_email)
  @client.call(method: :get, path: "suppression-list/#{recipient_email}")
end