VRFS-1483 editing batch emails

This commit is contained in:
Jonathan Kolyer 2014-03-19 16:37:03 +00:00
parent 74a5f3863a
commit 0987cf2cf8
8 changed files with 73 additions and 8 deletions

View File

@ -65,10 +65,11 @@ gem 'logging-rails', :require => 'logging/rails'
gem 'pg_migrate'
gem 'ruby-protocol-buffers', '1.2.2'
gem 'sendgrid', '1.1.0'
gem 'sendgrid', '1.2.0'
gem 'geokit-rails'
gem 'postgres_ext', '1.0.0'
gem 'resque_mailer'
group :libv8 do
gem 'libv8', "~> 3.11.8"
@ -106,6 +107,7 @@ group :development, :test do
gem 'factory_girl_rails', '4.1.0'
gem 'database_cleaner', '0.7.0'
gem 'launchy'
gem 'faker'
end
group :test do

View File

@ -0,0 +1,53 @@
ActiveAdmin.register JamRuby::EmailBatch, :as => 'Batch Emails' do
menu :label => 'Emails'
config.sort_order = 'updated_at DESC'
config.batch_actions = false
# config.clear_action_items!
config.filters = false
form :partial => 'form'
index do
column 'Subject' do |pp| pp.subject end
column 'Updated' do |pp| pp.updated_at end
column 'From' do |pp| pp.from_email end
column 'Status' do |pp| pp.aasm_state end
column 'Test Emails' do |pp| pp.test_emails end
column 'Email Count' do |pp| pp.qualified_count end
column 'Send Count' do |pp| pp.sent_count end
column 'Started At' do |pp| pp.started_at end
column 'Completed At' do |pp| pp.completed_at end
default_actions
end
# show do
# attributes_table do
# row 'Who?' do |obj| obj.text_short end
# row 'Quote' do |obj| obj.text_long end
# row :image do |obj|
# image_tag(obj.image_url, :size => '50x50')
# end
# row 'State' do |obj| obj.aasm_state end
# row 'Position' do |obj| obj.position end
# row 'Updated' do |obj| obj.updated_at end
# end
# end
controller do
def create
EmailBatch.create_with_params(params[:jam_ruby_email_batch])
redirect_to admin_batch_emails_path
end
def update
resource.update_with_conflict_validation(params[:jam_ruby_email_batch])
redirect_to admin_batch_email_path(resource.id)
end
end
end

View File

@ -0,0 +1,9 @@
<%= semantic_form_for([:admin, resource], :url => resource.new_record? ? admin_batch_emails_path : "/admin/batch_emails/#{resource.id}") do |f| %>
<%= f.inputs do %>
<%= f.input(:from_email, :label => "From Email", :input_html => {:maxlength => 64}) %>
<%= f.input(:subject, :label => "Subject", :input_html => {:maxlength => 128}) %>
<%= f.input(:test_emails, :label => "Test Emails", :input_html => {:maxlength => 1024, :size => '3x3'}) %>
<%= f.input(:body, :label => "Body", :input_html => {:maxlength => 3096, :size => '10x20'}) %>
<% end %>
<%= f.actions %>
<% end %>

View File

@ -27,7 +27,7 @@ gem 'eventmachine', '1.0.3'
gem 'amqp', '1.0.2'
gem 'will_paginate'
gem 'actionmailer', '3.2.13'
gem 'sendgrid'
gem 'sendgrid', '1.2.0'
gem 'aws-sdk', '1.29.1'
gem 'carrierwave'
gem 'aasm', '3.0.16'
@ -41,7 +41,6 @@ gem 'resque-retry'
gem 'resque-failed-job-mailer' #, :path => "/Users/seth/workspace/resque_failed_job_mailer"
gem 'resque-lonely_job', '~> 1.0.0'
gem 'resque_mailer'
gem 'sendgrid_smtpapi'
gem 'oj'
gem 'builder'
gem 'fog'

View File

@ -45,7 +45,7 @@ gem 'omniauth-twitter'
gem 'omniauth-google-oauth2', '0.2.1'
gem 'twitter'
gem 'fb_graph', '2.5.9'
gem 'sendgrid', '1.1.0'
gem 'sendgrid', '1.2.0'
gem 'recaptcha', '0.3.4'
gem 'filepicker-rails', '0.1.0'
gem 'aws-sdk', '1.29.1'
@ -68,6 +68,7 @@ gem 'resque-failed-job-mailer'
gem 'resque-dynamic-queues'
gem 'resque-lonely_job', '~> 1.0.0'
gem 'resque_mailer'
gem 'quiet_assets', :group => :development
gem 'bugsnag'
gem 'multi_json', '1.9.0'

View File

@ -107,8 +107,8 @@ if defined?(Bundler)
config.websocket_gateway_connect_time_stale = 2
config.websocket_gateway_connect_time_expire = 5
else
config.websocket_gateway_connect_time_stale = 12 # 12 matches production
config.websocket_gateway_connect_time_expire = 20 # 20 matches production
config.websocket_gateway_connect_time_stale = 60000 # 12 matches production
config.websocket_gateway_connect_time_expire = 100000 # 20 matches production
end
config.websocket_gateway_internal_debug = false
config.websocket_gateway_port = 6767 + ENV['JAM_INSTANCE'].to_i

View File

@ -68,8 +68,8 @@ SampleApp::Application.configure do
# it's nice to have even admin accounts (which all the default ones are) generate GA data for testing
config.ga_suppress_admin = false
config.websocket_gateway_connect_time_stale = 12 # 12 matches production
config.websocket_gateway_connect_time_expire = 20 # 20 matches production
config.websocket_gateway_connect_time_stale = 60000
config.websocket_gateway_connect_time_expire = 100000
config.audiomixer_path = ENV['AUDIOMIXER_PATH'] || audiomixer_workspace_path || "/var/lib/audiomixer/audiomixer/audiomixerapp"

View File

@ -0,0 +1 @@
Resque::Mailer.excluded_environments = [:test, :cucumber]