Class: Courier::Resources::Inbound

Inherits:
Object
  • Object
show all
Defined in:
lib/courier/resources/inbound.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Inbound

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 Inbound.

Parameters:



42
43
44
# File 'lib/courier/resources/inbound.rb', line 42

def initialize(client:)
  @client = client
end

Instance Method Details

#track_event(event:, message_id:, properties:, type:, user_id: nil, request_options: {}) ⇒ Courier::Models::InboundTrackEventResponse

Some parameter documentations has been truncated, see Models::InboundTrackEventParams for more details.

Courier Track Event

Parameters:

  • event (String)

    A descriptive name of the event. This name will appear as a trigger in the Couri

  • message_id (String)

    A required unique identifier that will be used to de-duplicate requests. If not

  • properties (Hash{Symbol=>Object})
  • type (Symbol, Courier::Models::InboundTrackEventParams::Type)
  • user_id (String, nil)

    The user id associated with the track

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

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
# File 'lib/courier/resources/inbound.rb', line 28

def track_event(params)
  parsed, options = Courier::InboundTrackEventParams.dump_request(params)
  @client.request(
    method: :post,
    path: "inbound/courier",
    body: parsed,
    model: Courier::Models::InboundTrackEventResponse,
    options: options
  )
end