Advertisement
Guest User

Untitled

a guest
Oct 9th, 2015
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. def create_signup_location
  2. glist = Gibbon::API.new.lists
  3. list_ids = glist.list(filters: { list_name: 'register' })['data'].map {|m| m['id'] }
  4.  
  5. list_ids.each do |list_id|
  6. payload = {
  7. id: list_id,
  8. tag: 'SIGNUP_LOC',
  9. name: 'Signup Location',
  10. options: {
  11. field_type: 'dropdown',
  12. req: false,
  13. public: true,
  14. show: true,
  15. choices: ['App', 'WebApp']
  16. }
  17. }
  18.  
  19. begin
  20. glist.merge_var_add(payload)
  21. rescue Gibbon::MailChimpError => ex
  22. puts ex.message
  23. end
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement