class WebhooksController < ApplicationController
  def mailchimp
    user = User.find_by(email: params[:data][:email])

    if user
      user.update_column(is_subscribed: false)
    end

    render nothing: true
  end
end

class WebhooksController < ApplicationController
  def mailchimp
    if params[:data] && params[:data][:email]
      user = User.find_by(email: params[:data][:email])

      if user
        user.update_column(is_subscribed: false)
      end
    end

    render nothing: true
  end
end

Add extra if statement so mailchimp doesn't get pissed off.
Add extra if statement so mailchimp doesn't get pissed off.
