I am trying to use the gem mailchimp-api-ruby to add users to a list. But when i use mailchimp.lists.subscribe it sends an email to the users asking them to confirm before they end up in the list. I know that double_optin => false should fix this but i haven't been able to make it work. I am sure it is some kind of formatting that is wrong. I don't think the documentation is very clear and have tried every combination i can think of. Could someone please help me :)
Right now i have the following:
mailchimp = Mailchimp::API.new(Rails.application.secrets.mailchimp_api_key)
mailchimp.lists.subscribe("list_id",
{"email" => "test@gmail.com" },
{'FNAME' => @user.firstname, 'LNAME' => @user.lastname},
:EMAIL_TYPE => 'html',
:double_optin => false
)