switch to AMZ SES, add bad audio

This commit is contained in:
Seth Call 2020-05-26 23:19:50 -05:00
parent d569338f8f
commit 20804ff389
42 changed files with 96 additions and 38 deletions

View File

@ -111,6 +111,7 @@ module JamAdmin
config.redis_host = "localhost:6379"
config.bugs_alias = 'bugs@jamkazam.com'
config.email_support_alias = 'support@jamkazam.com'
config.email_social_alias = 'social@jamkazam.com'
config.email_alerts_alias = 'alerts@jamkazam.com' # should be used for 'oh no' server down/service down sorts of emails

View File

@ -92,6 +92,7 @@ require "jam_ruby/connection_manager"
require "jam_ruby/version"
require "jam_ruby/environment"
require "jam_ruby/init"
require "jam_ruby/app/mailers/mailer_helper"
require "jam_ruby/app/mailers/admin_mailer"
require "jam_ruby/app/mailers/user_mailer"
require "jam_ruby/app/mailers/invited_user_mailer"

View File

@ -61,6 +61,16 @@ module JamRuby
subject: options[:subject])
end
def pretty(options)
mail(to: options[:to],
cc: options[:cc],
from: APP_CONFIG.email_generic_from,
body: options[:body],
content_type: "text/html",
subject: options[:subject])
end
def recurly_alerts(user, options)
body = options[:body]

View File

@ -0,0 +1,6 @@
module MailerHelper
def sendgrid_substitute(arg1, arg2)
@vars = Hash.new unless @vars
@vars[arg1] = arg2[0]
end
end

View File

@ -8,6 +8,7 @@ module JamRuby
# Templates for UserMailer can be found in jam_ruby/app/views/jam_ruby/user_mailer
class UserMailer < ActionMailer::Base
include SendGrid
include MailerHelper
layout "user_mailer"

View File

@ -1,6 +1,6 @@
<% provide(:title, @title) %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<p>We noticed that you have downloaded the free JamKazam application, but you have not yet run the app. You can find other musicians and listen to sessions and recordings on our website, but you need to run the JamKazam application to play with other musicians online. If you are having trouble installing or running the app, please visit our JamKazam support center at the link below, and post a request for assistance so that we can help you get up and running.

View File

@ -1,6 +1,6 @@
<%= @title %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
We noticed that you have downloaded the free JamKazam application, but you have not yet run the app. You can find other musicians and listen to sessions and recordings on our website, but you need to run the JamKazam application to play with other musicians online. If you are having trouble installing or running the app, please visit our JamKazam support center at the link below, and post a request for assistance so that we can help you get up and running.

View File

@ -1,6 +1,6 @@
<% provide(:title, @title) %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<p>We noticed that you have registered as a JamKazam musician, but you have not yet downloaded and started using the free JamKazam application. You can find other musicians and listen to sessions and recordings on our website, but you need the free JamKazam application to play with other musicians online. Please click the link below to go to the download page for the free JamKazam application, or visit our JamKazam support center so that we can help you get up and running.

View File

@ -1,6 +1,6 @@
<%= @title %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
We noticed that you have registered as a JamKazam musician, but you have not yet downloaded and started using the free JamKazam application. You can find other musicians and listen to sessions and recordings on our website, but you need the free JamKazam application to play with other musicians online. Please click the link below to go to the download page for the free JamKazam application, or visit our JamKazam support center so that we can help you get up and running.

View File

@ -1,6 +1,6 @@
<% provide(:title, @title) %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<p>We noticed that you have not yet successfully set up your audio gear and passed the JamKazam latency and input/output audio gear tests. This means that you cannot yet play in online sessions with other musicians. If you are having trouble with this step, please click the link below for a knowledge base article that can help you get past this hurdle. If the test says your audio gear is not fast enough, or if your audio quality sounds poor, or if you are just confused, its very likely the tips in this article will help you get things set up and optimized so you can start playing online.

View File

@ -1,6 +1,6 @@
<%= @title %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
We noticed that you have not yet successfully set up your audio gear and passed the JamKazam latency and input/output audio gear tests. This means that you cannot yet play in online sessions with other musicians. If you are having trouble with this step, please click the link below for a knowledge base article that can help you get past this hurdle. If the test says your audio gear is not fast enough, or if your audio quality sounds poor, or if you are just confused, its very likely the tips in this article will help you get things set up and optimized so you can start playing online.

View File

@ -1,6 +1,6 @@
<% provide(:title, @title) %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<p>We noticed that you havent yet played in a JamKazam session with multiple musicians that lasted long enough to be productive or fun. Since thats the whole point of the service, we wanted to reach out to see if we can help you. Please take a quick look at the suggestions below to see if they help you!

View File

@ -1,6 +1,6 @@
<%= @title %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
We noticed that you havent yet played in a JamKazam session with multiple musicians that lasted long enough to be productive or fun. Since thats the whole point of the service, we wanted to reach out to see if we can help you. Please take a quick look at the suggestions below to see if they help you!

View File

@ -1,6 +1,6 @@
<% provide(:title, @title) %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<p>We noticed that you havent yet connected with any friends on JamKazam. Connecting with friends is the best way to help you get into sessions with other musicians on JamKazam. Here are a couple of good ways to connect with others.

View File

@ -1,6 +1,6 @@
<%= @title %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
We noticed that you havent yet connected with any friends on JamKazam. Connecting with friends is the best way to help you get into sessions with other musicians on JamKazam. Here are a couple of good ways to connect with others.

View File

@ -1,6 +1,6 @@
<% provide(:title, @title) %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<p>We noticed that you have not invited any of your friends to join you to play together on JamKazam. Its still very early in our companys development, so we dont have zillions of users online on our service yet. One of the best ways to connect and play with others is to invite your friends from the “real world” to join you on JamKazam, and then set up a time to meet online and get into a session together. To do this, just go to www.jamkazam.com and sign in. Then move your mouse over your picture or name in the upper right corner of the screen. A menu will be displayed. Click the Invite Friends option, and then you can click Facebook, Google, or Email to easily invite your friends from different services to join you on JamKazam.

View File

@ -1,6 +1,6 @@
<%= @title %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
We noticed that you have not invited any of your friends to join you to play together on JamKazam. Its still very early in our companys development, so we dont have zillions of users online on our service yet. One of the best ways to connect and play with others is to invite your friends from the “real world” to join you on JamKazam, and then set up a time to meet online and get into a session together. To do this, just go to www.jamkazam.com and sign in. Then move your mouse over your picture or name in the upper right corner of the screen. A menu will be displayed. Click the Invite Friends option, and then you can click Facebook, Google, or Email to easily invite your friends from different services to join you on JamKazam.

View File

@ -1,6 +1,6 @@
<% provide(:title, @title) %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<p>JamKazam is a young company/service built through the sweat and commitment of a small group of music-loving techies. Please help us continue to grow the service and attract more musicians to play online by liking and/or following us on Facebook, Twitter, and Google+. Just click the icons below to give us little push, thanks!

View File

@ -1,6 +1,6 @@
<%= @title %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
JamKazam is a young company/service built through the sweat and commitment of a small group of music-loving techies. Please help us continue to grow the service and attract more musicians to play online by liking and/or following us on Facebook, Twitter, and Google+. Just click the icons below to give us little push, thanks!

View File

@ -1,6 +1,6 @@
<% provide(:title, @title) %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<p>We noticed that you havent yet rated any of your JamKazam sessions as “good”. It may be that you just are not a “rater”, and that is totally fine. But if you are not having good, high quality, productive and fun sessions, we want to help you get there!

View File

@ -1,6 +1,6 @@
<%= @title %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
We noticed that you havent yet rated any of your JamKazam sessions as “good”. It may be that you just are not a “rater”, and that is totally fine. But if you are not having good, high quality, productive and fun sessions, we want to help you get there!

View File

@ -1,6 +1,6 @@
<% provide(:title, @title) %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<p>We noticed that you havent yet made a recording during any of your JamKazam sessions. Recordings are extra special on JamKazam because:

View File

@ -1,6 +1,6 @@
<%= @title %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
We noticed that you havent yet made a recording during any of your JamKazam sessions. Recordings are extra special on JamKazam because:

View File

@ -2,7 +2,7 @@
<% if !@user.anonymous? %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<% end %>

View File

@ -1,5 +1,5 @@
<% if !@user.anonymous? %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %>
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %>
<% end %>
Thank you for expressing an interest in exploring our secondary education partner program! A member of our staff will

View File

@ -2,7 +2,7 @@
<% if !@user.anonymous? %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<% end %>

View File

@ -1,5 +1,5 @@
<% if !@user.anonymous? %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %>
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %>
<% end %>
Thank you for expressing an interest in exploring our retailer partner program! A member of our staff will reach out to you shortly to chat with you and answer any/all questions you may have about our partner program and our technologies.

View File

@ -2,7 +2,7 @@
<% if !@user.anonymous? %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<% end %>

View File

@ -1,5 +1,5 @@
<% if !@user.anonymous? %>
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %>
Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %>
<% end %>
Thank you for expressing an interest in exploring our music school partner program! A member of our staff will reach out to you shortly to chat with you and answer any/all questions you may have about our partner program, our technologies, and how we can help you continue to build your music school business.

View File

@ -2,7 +2,7 @@
<% if !@user.anonymous? %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<% end %>

View File

@ -1,4 +1,4 @@
<% if !@user.anonymous? %>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --<% end %>
<% if !@user.anonymous? %>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --<% end %>
Thank you for signing up to take online music lessons using the JamClass service by JamKazam. JamKazam technology was
built from the ground up for playing music live in sync with high quality audio from different locations over the

View File

@ -2,7 +2,7 @@
<% if !@user.anonymous? %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<% end %>

View File

@ -1,4 +1,4 @@
<% if !@user.anonymous? %>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --<% end %>
<% if !@user.anonymous? %>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --<% end %>
Thank you for signing up to take online music lessons using the JamClass service by JamKazam. JamKazam technology was
built from the ground up for playing music live in sync with high quality audio from different locations over the

View File

@ -2,7 +2,7 @@
<% if !@user.anonymous? %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<% end %>

View File

@ -1,4 +1,4 @@
<% if !@user.anonymous? %>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<% if !@user.anonymous? %>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
<% end %>
Thank you for signing up to teach online music lessons using the JamClass service by JamKazam. JamKazam technology was

View File

@ -2,7 +2,7 @@
<% if !@user.anonymous? %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
<p>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --
</p>
<% end %>

View File

@ -1,4 +1,4 @@
<% if !@user.anonymous? %>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --<% end %>
<% if !@user.anonymous? %>Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --<% end %>
We're delighted that you have decided to try the JamKazam service, and we hope that you will enjoy using JamKazam to play music with others. Following are some resources that can help you get oriented and get the most out of JamKazam.

View File

@ -23,10 +23,14 @@ def app_config
'support@jamkazam.com'
end
def bugs_alias
'bugs@jamkazam.com'
end
def email_jamclass_alerts_alias
'jamclass-alerts@jamkazam.com'
end
def email_crashes_alias
'clientcrash@jamkazam.com'
end

View File

@ -1,7 +1,7 @@
class ApiAlertsController < ApiController
before_filter :api_signed_in_user
before_filter :api_signed_in_user, only: :create
def log
@ -36,4 +36,37 @@ class ApiAlertsController < ApiController
end
def bad_audio
subject = "Bad Audio"
body = header
if current_user
subject + " - #{current_user.name}"
body << "<h1>User - #{current_user.name} - #{current_user.email}</h1>"
end
#body << params.to_yaml
body << "<br/><br/>"
body << "<pre>"
body << JSON.pretty_generate(params["api_alert"])
body << "</pre>"
AdminMailer.pretty({ to: Rails.application.config.bugs_alias,
subject:params[:subject] || subject,
body:body
}).deliver_now
render json: {}, :status => :ok
end
private
def header
"<html><body>"
end
def footer
"</body></html>"
end
end

View File

@ -249,6 +249,7 @@ if defined?(Bundler)
config.estimated_slow_mixdown_time = 80
config.num_packaging_nodes = 2
config.bugs_alias = 'bugs@jamkazam.com'
config.email_support_alias = 'support@jamkazam.com'
config.email_partners_alias = 'partners@jamkazam.com'
config.email_social_alias = 'social@jamkazam.com'
@ -257,12 +258,12 @@ if defined?(Bundler)
config.email_jamclass_alerts_alias= 'jamclass-alerts@jamkazam.com'
config.email_generic_from = 'nobody@jamkazam.com'
config.email_recurly_notice = 'recurly-alerts@jamkazam.com'
config.email_smtp_address = 'smtp.sendgrid.net'
config.email_smtp_address = 'email-smtp.us-east-1.amazonaws.com'
config.email_smtp_port = 587
config.email_smtp_domain = 'www.jamkazam.com'
config.email_smtp_authentication = :plain
config.email_smtp_user_name = 'jamkazam'
config.email_smtp_password = 'snorkeltoesniffyfarce1'
config.email_smtp_user_name = 'AKIA2SXEHOQFKRW3OWMG' # ses-smtp-user.20200526-212148
config.email_smtp_password = 'BJZEdTkTcuIrN1koG40PQ2JLHdMmTprC/aLj48Q5KhWJ'
config.email_smtp_starttls_auto = true
config.sendgrid_username = 'jamkazam'

View File

@ -17,5 +17,5 @@ ActionMailer::Base.smtp_settings = {
Rails.logger.debug("ActionMailer.delivery_method = #{ActionMailer::Base.delivery_method}")
SendgridToolkit.api_user = Rails.application.config.sendgrid_username
SendgridToolkit.api_key = Rails.application.config.sendgrid_password
#SendgridToolkit.api_user = Rails.application.config.sendgrid_username
#SendgridToolkit.api_key = Rails.application.config.sendgrid_password

View File

@ -740,6 +740,7 @@ Rails.application.routes.draw do
match '/signup_hints/:id' => 'api_signup_hints#show', :via => :get, :as => :api_signup_hint_detail
match '/alerts' => 'api_alerts#create', :via => :post
match '/live_streams/bad_audio' => 'api_alerts#bad_audio', :via => :post # used by client; don't change route
# links generated to help affiliates share relevant links
get '/links/jamtrack_songs' => 'api_links#jamtrack_song_index'