Class: Courier::Resources::Requests

Inherits:
Object
  • Object
show all
Defined in:
lib/courier/resources/requests.rb,
sig/courier/resources/requests.rbs

Overview

Look up the messages Courier has accepted, inspect their delivery history and rendered output, and cancel, resend, or archive them.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Requests

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Requests.

Parameters:



32
33
34
# File 'lib/courier/resources/requests.rb', line 32

def initialize(client:)
  @client = client
end

Instance Method Details

#archive(request_id, request_options: {}) ⇒ nil

Archives a send request by its request id. Use it to remove test sends or superseded requests from the message list without deleting them.

Parameters:

  • request_id (String)

    A unique identifier representing the request ID

  • request_options (Courier::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



20
21
22
23
24
25
26
27
# File 'lib/courier/resources/requests.rb', line 20

def archive(request_id, params = {})
  @client.request(
    method: :put,
    path: ["requests/%1$s/archive", request_id],
    model: NilClass,
    options: params[:request_options]
  )
end