Module: Millionsend::Contacts::Topics

Defined in:
lib/millionsend/contacts.rb

Overview

Topic subscriptions of one contact, in resend-ruby's nested shape.

Class Method Summary collapse

Class Method Details

.list(params) ⇒ Object

GET /contacts/:id_or_email/topics — { id: | email: } or a bare id/email. Every topic comes back with the contact's effective subscription (explicit: false means it is the topic's default, not a stored choice) and its visibility ("public" | "private"). Unpaginated, like Topics.list.



86
87
88
# File 'lib/millionsend/contacts.rb', line 86

def list(params)
  Millionsend::Request.new(method: :get, path: "#{Millionsend::Contacts.member_path(params)}/topics").perform
end

.update(params) ⇒ Object

PATCH /contacts/:id_or_email/topics — { id: | email:, topics: [{ id:, subscription: }] }.



91
92
93
# File 'lib/millionsend/contacts.rb', line 91

def update(params)
  Millionsend::Contacts.topics_update(params, params[:topics])
end