Mandrill: Please enter an array

Viewed 2647

I can't understand why I get an Invalid array!

response = Unirest.post "#{@@endpoint}/messages/send.json", 
                        headers:{ "Accept" => "application/json" }, 
                        parameters:{ 
                            :key => @@apikey, 
                            :message => {
                                :text => "example text",
                                :subject => "bla bla",
                                :from_email => "info@site.com",
                                :from_name => "site.com",
                                to: [
                                        {
                                            :email => "myemail@gmail.com",
                                            :name  => "myname",
                                            :type  => "to"
                                        }
                                ]
                            }
                        }

I get this error

{"status":"error","code":-2,"name":"ValidationError","message":"Validation error: {\"message\":{\"to\":[\"Please enter an array\"]}}"}
1 Answers
Related