Skip to content
Common stuff for rails applications
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.gitignore
CHANGELOG
Gemfile
MIT-LICENSE
README.md
Rakefile
rails-commons.gemspec

README.md

Common stuff for Rails applications

Adding user to a mailing list

Update Gemfile with:

gem 'gibbon'

Add following entries to secrets.yml

mailchimp_key: <%= ENV['MAILCHIMP_KEY'] %>
mailchimp_list_id: <%= ENV['MAILCHIMP_LIST_ID'] %>
mailchimp_interest_ids: <%= ENV['MAILCHIMP_INTEREST_IDS'] %>

Create file config/initializers/mailchimp.rb

Gibbon::Request.api_key = Rails.application.secrets.mailchimp_key
Gibbon::Request.timeout = 15
Gibbon::Request.logger = Rails.logger

Call SubscribeJob.perform_later('email@me.com') to add a subscriber to your list.

MailChimp helper tasks

List all mailing lists for you account:

rails commons:mailchimp:lists

All lists with interests included:

rails commons:mailchimp:interests 

Crashing job for testing

RailsCommons::CrashingJob.perform_later(id: 123)

So you can test out ErrBit/AirBrake/NewRelic, etc.

Requirements

Ruby 2.0+, ActiveRecord 5+, Rails 5+

You can’t perform that action at this time.