ianterrell/refinerycms-mailchimp — Issue #6: Errors are not being displayed
Author: dsaronin
Created: 2012-01-09 05:08:11+00:00
State: open

While trying to debug why MailChimp is not saving any campaigns, I noticed that even though errors are being generated in the model (Campaign), they are not being displayed in the admin dashboard. Further, the model is not correctly recording the errors that are coming back from the MailChimp API. I am using RefineryCMS 1.0.9 on Rails 3.0.10 with Ruby 1.9.3 (local) and Ruby 1.9.2 (heroku host).

Using the exact same parameters (as being sent after filling in the new campaign form & clicking save), I can go into the Rails Console and mimic the behavior by working directly with the Campaign model

The model returns the following error (from Campaign.create( params ) )

"Could not save to Mailchimp! Please make sure your API key is right and that you are using a good 'From' email address."

but in reality, the error from the API is: (Refinery::Mailchimp::API.new.campaign_create 'regular', options, { :html_MAIN => x.body } )

Hominid::APIError: <311> Your list has an email type option, so the text part is required

and the controller (in the admin dashboard) says:

'WildBlue' was successfully added.

but doesn't show any campaigns in the list, and no campaigns are saved to the database.