Class: Mailtrap::ContactEventsAPI

Inherits:
Object
  • Object
show all
Includes:
BaseAPI
Defined in:
lib/mailtrap/contact_events_api.rb

Instance Attribute Summary

Attributes included from BaseAPI

#account_id, #client

Instance Method Summary collapse

Methods included from BaseAPI

included, #initialize

Instance Method Details

#create(contact_identifier, options) ⇒ ContactEvent

Creates a contact event

Parameters:

  • contact_identifier (String)

    The contact UUID or email address

  • options (Hash)

    The event parameters

Options Hash (options):

  • :name (String)

    The event name (max 255 characters)

  • :params (Hash)

    A hash of string keys and scalar values

Returns:

Raises:



22
23
24
25
26
# File 'lib/mailtrap/contact_events_api.rb', line 22

def create(contact_identifier, options)
  validate_options!(options, supported_options)
  response = client.post(base_path(contact_identifier), options)
  build_entity(response, ContactEvent)
end