Skip to content
Browse files

allow disable via config file

  • Loading branch information...
1 parent 202d39d commit 494cc82200c5aaf5a1a3c67344d13c3de250b8e2 @garygreyling garygreyling committed Apr 5, 2011
Showing with 5 additions and 3 deletions.
  1. +1 −0 README.rdoc
  2. +1 −1 Rakefile
  3. +3 −2 lib/campaign_monitor_subscriber.rb
View
1 README.rdoc
@@ -21,6 +21,7 @@ Specify the model's email address field name:
Set the list id & api key in config/campaign_monitor_subscriber_config.yml:
list_id: 12oeu0089oe8gf9794oe498587o5
api_key: 23rbmoe351sd123d12134hbi1234
+ development: false # disable in development
Thats it!
View
2 Rakefile
@@ -3,7 +3,7 @@ require 'rubygems'
require 'rake'
require 'echoe'
-Echoe.new('campaign_monitor_subscriber', '0.6.2') do |p|
+Echoe.new('campaign_monitor_subscriber', '0.6.3') do |p|
p.description = "Sync user emails with Campaign Monitor mailing lists"
p.url = "http://github.com/mpowered/campaign_monitor_subscriber"
p.author = "Gary Greyling"
View
5 lib/campaign_monitor_subscriber.rb
@@ -1,9 +1,10 @@
module CampaignMonitorSubscriber
require 'campaigning'
- ::CAMPAIGN_MONITOR_API_KEY = YAML::load_file(File.join(RAILS_ROOT, "config/campaign_monitor_subscriber_config.yml"))['api_key']
+ CM_CONFIG = YAML::load_file(File.join(RAILS_ROOT, "config/campaign_monitor_subscriber_config.yml"))
+ ::CAMPAIGN_MONITOR_API_KEY = CM_CONFIG['api_key']
def subscribe_me_using(email_field)
- # return unless RAILS_ENV == 'production'
+ return if CM_CONFIG[RAILS_ENV] == false
after_create do |record|
begin

0 comments on commit 494cc82

Please sign in to comment.
Something went wrong with that request. Please try again.