Sha256: ff4143de59b5675ee8b373d2d06e3ecf9d7447e5c8ecefa618efe850e71893b8
Contents?: true
Size: 746 Bytes
Versions: 2
Compression:
Stored size: 746 Bytes
Contents
module CMS class MailchimpController < RailsAdminCMS::Config.parent_controller invisible_captcha only: [:subscribe] def subscribe respond_to do |format| format.js do begin gb = Gibbon::API.new(Rails.application.secrets.mailchimp_api_key, { timeout: 15 }) gb.lists.subscribe( id: Rails.application.secrets.send(:"mailchimp_list_id_#{I18n.locale}"), email: { email: params[:mailchimp][:email] }, double_optin: false ) flash_now!(:success) rescue Gibbon::MailChimpError => exception cms_logger exception, 'mailchimp' flash_now!(:error) end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rails_admin_cms-0.1.1 | app/controllers/cms/mailchimp_controller.rb |
rails_admin_cms-0.0.9 | app/controllers/cms/mailchimp_controller.rb |