diff --git a/admin/Gemfile b/admin/Gemfile index 5ec8a3411..5fea93d71 100644 --- a/admin/Gemfile +++ b/admin/Gemfile @@ -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 diff --git a/admin/app/admin/email_batch.rb b/admin/app/admin/email_batch.rb new file mode 100644 index 000000000..8aaa0700b --- /dev/null +++ b/admin/app/admin/email_batch.rb @@ -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 diff --git a/admin/app/views/admin/batch_emails/_form.html.erb b/admin/app/views/admin/batch_emails/_form.html.erb new file mode 100644 index 000000000..a9c83f836 --- /dev/null +++ b/admin/app/views/admin/batch_emails/_form.html.erb @@ -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 %> diff --git a/ruby/Gemfile b/ruby/Gemfile index ae98be72b..cd4bca5ec 100644 --- a/ruby/Gemfile +++ b/ruby/Gemfile @@ -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' diff --git a/web/Gemfile b/web/Gemfile index af835a453..f2cdab689 100644 --- a/web/Gemfile +++ b/web/Gemfile @@ -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' diff --git a/web/config/application.rb b/web/config/application.rb index 5f1e18959..ff213c11a 100644 --- a/web/config/application.rb +++ b/web/config/application.rb @@ -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 diff --git a/web/config/environments/development.rb b/web/config/environments/development.rb index 188a87ed9..91835c64b 100644 --- a/web/config/environments/development.rb +++ b/web/config/environments/development.rb @@ -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" diff --git a/web/config/initializers/resque_mailer.rb b/web/config/initializers/resque_mailer.rb new file mode 100644 index 000000000..5a9e2bcdb --- /dev/null +++ b/web/config/initializers/resque_mailer.rb @@ -0,0 +1 @@ +Resque::Mailer.excluded_environments = [:test, :cucumber]