Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'json'
- custom_fields = [
- { :Key => 'memstatus', :Value => "{account_status}"},
- { :Key => 'memtype', :Value => "{user.member_type}"},
- { :Key => 'memsincedate', :Value => "{member_since.to_date}"},
- { :Key => 'memrenewaldate', :Value => "{user.account.renewal_date.to_date}"},
- { :Key => 'usertype', :Value => "{user_type}"},
- #{ :Key => 'neighborhood group', :Value => "#{neighborhood_groups.join('||')}", :DataType => 'Multi-Options'},
- #{ :Key => 'social group', :Value => "social_groups.join('||')", :DataType => 'Multi-Options'}
- ]
- neighborhood_groups = %w[ a b c ]
- neighborhood_groups.each {|value| custom_fields << {:Key => 'neighborhood group', :Value => "#{value}"}}
- social_groups = %w[ 1 2 3 ]
- social_groups.each {|value| custom_fields << {:Key => 'social group', :Value => "#{value}"}}
- subscribers = [{ :EmailAddress => "{user.email}", :Name => "{user.last_name}, {user.first_name}", :CustomFields => custom_fields }]
- puts JSON.generate(subscribers)
Add Comment
Please, Sign In to add comment