Class: Hubspot::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/event.rb

Overview

Constant Summary collapse

POST_EVENT_PATH =
'/v1/event'

Class Method Summary collapse

Class Method Details

.trigger(event_id, email, options = {}) ⇒ Object



13
14
15
16
17
18
# File 'lib/hubspot/event.rb', line 13

def trigger(event_id, email, options = {})
  default_params = { _n: event_id, _a: Hubspot::Config.portal_id, email: email }
  options[:params] = default_params.merge(options[:params] || {})

  Hubspot::EventConnection.trigger(POST_EVENT_PATH, options).success?
end