Module: Millionsend::Contacts::Segments

Defined in:
lib/millionsend/contacts.rb

Overview

Segment membership of one contact. Segments are dynamic filters, so this only applies to segments that hold an explicit member list.

Class Method Summary collapse

Class Method Details

.add(id_or_email, segment_id = nil) ⇒ Object

POST /contacts/:id_or_email/segments/:segment_id. Takes (id_or_email, segment_id) or resend-ruby's { contact_id: | email:, segment_id: }.



145
146
147
# File 'lib/millionsend/contacts.rb', line 145

def add(id_or_email, segment_id = nil)
  Millionsend::Request.new(method: :post, path: path(id_or_email, segment_id)).perform
end

.remove(id_or_email, segment_id = nil) ⇒ Object

DELETE /contacts/:id_or_email/segments/:segment_id — same shapes as add.



150
151
152
# File 'lib/millionsend/contacts.rb', line 150

def remove(id_or_email, segment_id = nil)
  Millionsend::Request.new(method: :delete, path: path(id_or_email, segment_id)).perform
end