Skip to content

Instantly share code, notes, and snippets.

@kahirul
Last active October 9, 2015 05:20
Show Gist options
  • Save kahirul/97778fcc8832918d9164 to your computer and use it in GitHub Desktop.
Save kahirul/97778fcc8832918d9164 to your computer and use it in GitHub Desktop.
Create Signup Location
def create_signup_location
glist = Gibbon::API.new.lists
list_ids = glist.list(filters: { list_name: 'register' })['data'].map {|m| m['id'] }
list_ids.each do |list_id|
payload = {
id: list_id,
tag: 'SIGNUP_LOC',
name: 'Signup Location',
options: {
field_type: 'dropdown',
req: false,
public: true,
show: true,
choices: ['App', 'WebApp']
}
}
begin
glist.merge_var_add(payload)
rescue Gibbon::MailChimpError => ex
puts ex.message
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment