Browse files

Custom fields handling.

  • Loading branch information...
1 parent 81053cc commit b82c501138037b0ddc579b3f246105c551dbbf98 @anwajler anwajler committed Jul 19, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/campaign_monitor_subscriber.rb
View
2 lib/campaign_monitor_subscriber.rb
@@ -7,7 +7,7 @@ def subscribe_me_using(email_field, custom_fields={})
return if CM_CONFIG[::Rails.env] == false
after_create do |record|
begin
- custom_fields = custom_fields.map{|k,v| {k => record.send(v)}}
+ custom_fields = custom_fields.inject({}) { |h, (k, v)| h[k] = record.send(v); h }
s = Campaigning::Subscriber.new(record.send(email_field), custom_fields["name"])
s.add!(CM_CONFIG['list_id'], custom_fields)
rescue RuntimeError

0 comments on commit b82c501

Please sign in to comment.