Commit 9c6bed03

mo <mokha@cisco.com>
2017-09-02 03:49:57
remove subscriptions page.
1 parent 09f1f23
Changed files (7)
app/controllers/admin/subscriptions_controller.rb
@@ -1,9 +0,0 @@
-module Admin
-  class SubscriptionsController < AdminController
-    def index
-      members =  Gibbon::API.lists.members({ id: ENV['MAILCHIMP_LIST_ID'], status: 'subscribed'})
-      @subscriptions = members["data"]
-      @total = members["total"]
-    end
-  end
-end
app/models/subscription.rb
@@ -1,15 +0,0 @@
-class Subscription
-  def self.subscribe(email:, first_name:, last_name:, list_id: ENV['MAILCHIMP_LIST_ID'])
-    return if Rails.env.test?
-
-    Gibbon::API.lists.subscribe({
-      id: list_id,
-      email: { email: email },
-      merge_vars: {
-        FNAME: first_name,
-        LNAME: last_name
-      },
-      double_optin: false
-    })
-  end
-end
app/models/user.rb
@@ -47,7 +47,6 @@ class User < ActiveRecord::Base
 
   def send_welcome_email
     UserMailer.welcome_email(self).deliver_later
-    Subscription.delay.subscribe(email: email, first_name: name, last_name: '')
   end
 
   def recent_activities(limit = 20)
app/views/admin/subscriptions/index.html.erb
@@ -1,26 +0,0 @@
-<div class="row-fluid">
-  <div class="span2">
-    <%= render partial: "my/shared/my_nav" %>
-  </div>
-  <div class="span10">
-    <h1>Subscriptions <small>(<%= @total %>)</small></h1>
-    <table class="table table-condensed">
-      <thead>
-        <tr>
-          <th></th>
-          <th>Email</th>
-          <th>Timestamp</th>
-        </tr>
-      </thead>
-      <tbody>
-      <% @subscriptions.each_with_index do |subscription, index| %>
-        <tr>
-        <td><%= index+1 %></td>
-        <td><%= subscription["email"] %></td>
-        <td><%= subscription["timestamp_signup"] %></td>
-      </tr>
-      </tbody>
-    <% end %>
-    </table>
-  </div>
-</div>
config/initializers/mailchimp.rb
@@ -1,3 +0,0 @@
-Gibbon::Request.api_key = ENV['MAILCHIMP_API_KEY']
-Gibbon::Request.timeout = 15
-Gibbon::Request.throws_exceptions = false
.env.example
@@ -15,10 +15,6 @@ EXCEPTION_EMAIL_ADDRESS=?@cakeside.com
 FACEBOOK_APP_ID=''
 FOG_DIRECTORY=cakeside_local
 GOOGLE_ANALYTICS=''
-MAILCHIMP_API_KEY=''
-MAILCHIMP_LIST_ID=''
-MIXPANEL_API_KEY=''
-NEWRELIC_KEY=''
 SMTP_DOMAIN=''
 SMTP_HOST=''
 SMTP_PASSWORD=''
Gemfile
@@ -22,7 +22,6 @@ gem 'asset_sync', '~> 2.0.0'
 gem 'fog-aws'
 gem 'unf'
 gem 'exception_notification'
-gem 'gibbon'
 gem 'twitter'
 gem 'spank'
 gem 'exifr'