Module: Convertkit::Client::Forms

Included in:
Convertkit::Client
Defined in:
lib/convertkit/client/forms.rb

Instance Method Summary collapse

Instance Method Details

#add_subscriber_to_form(form_id, email, options = {}) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/convertkit/client/forms.rb', line 8

def add_subscriber_to_form(form_id, email, options = {})
  connection.post("forms/#{form_id}/subscribe") do |f|
    f.params['email'] = email
    f.params['first_name'] = options[:first_name]
    f.params['fields'] = options[:fields]
    f.params['tags'] = options[:tags]
  end
end

#formsObject



4
5
6
# File 'lib/convertkit/client/forms.rb', line 4

def forms
  connection.get("forms").body["forms"]
end