Last active
October 9, 2015 05:20
-
-
Save kahirul/97778fcc8832918d9164 to your computer and use it in GitHub Desktop.
Create Signup Location
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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