Viral Rails

How to connect Mailchimp -Video 8

How to connect Mailchimp -Video 8

On February 11, 2016, Posted by , In Gibbon Gem,Mailchimp, With No Comments

Table Of Contents

Setting up your Mailchimp API key and installing the Gibbon gem

Connect Gibbon to Mailchimp

Step 1: Create a Mailchimp account. http://mailchimp.com/

Step 2: Add this code to your config/application.rb file

config.before_configuration do
env_file = File.join(Rails.root, ‘config’, ‘local_env.yml’)
YAML.load(File.open(env_file)).each do |key, value|
ENV[key.to_s] = value
end if File.exists?(env_file)
end

Also, add the gibbon gem to your gem file. Copy and paste the code below.

gem ‘gibbon’, ‘~> 2.2’, ‘>= 2.2.1’

https://github.com/amro/gibbon

Then run:

bundle install

Step 3: Create and configure the local_env.yml file

Step 4: Run this line in your terminal and don’t forget to add your mailchimp api key

heroku config:set MAILCHIMP_API_KEY=YOURAPIKEY

Step 5: Run this code in your terminal

rake db:reset

and

heroku run rake db:reset (IMPORTANT: don’t ever run this unless you’re willing to delete all the data in your app. I only do this to reset the ip blocker for testing purposes.)

Leave a Reply

Your email address will not be published. Required fields are marked *