From 20804ff3894205d9dd7fc63844ed25d6f6917aa1 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 26 May 2020 23:19:50 -0500 Subject: [PATCH] switch to AMZ SES, add bad audio --- admin/config/application.rb | 1 + ruby/lib/jam_ruby.rb | 1 + ruby/lib/jam_ruby/app/mailers/admin_mailer.rb | 10 ++++++ .../lib/jam_ruby/app/mailers/mailer_helper.rb | 6 ++++ ruby/lib/jam_ruby/app/mailers/user_mailer.rb | 1 + .../progress_mailer/client_dl_notrun.html.erb | 2 +- .../progress_mailer/client_dl_notrun.text.erb | 2 +- .../progress_mailer/client_notdl.html.erb | 2 +- .../progress_mailer/client_notdl.text.erb | 2 +- .../client_run_notgear.html.erb | 2 +- .../client_run_notgear.text.erb | 2 +- .../progress_mailer/gear_notsess.html.erb | 2 +- .../progress_mailer/gear_notsess.text.erb | 2 +- .../progress_mailer/reg_notconnect.html.erb | 2 +- .../progress_mailer/reg_notconnect.text.erb | 2 +- .../progress_mailer/reg_notinvite.html.erb | 2 +- .../progress_mailer/reg_notinvite.text.erb | 2 +- .../progress_mailer/reg_notlike.html.erb | 2 +- .../progress_mailer/reg_notlike.text.erb | 2 +- .../progress_mailer/sess_notgood.html.erb | 2 +- .../progress_mailer/sess_notgood.text.erb | 2 +- .../progress_mailer/sess_notrecord.html.erb | 2 +- .../progress_mailer/sess_notrecord.text.erb | 2 +- .../education_owner_welcome_message.html.erb | 2 +- .../education_owner_welcome_message.text.erb | 2 +- .../retailer_owner_welcome_message.html.erb | 2 +- .../retailer_owner_welcome_message.text.erb | 2 +- .../school_owner_welcome_message.html.erb | 2 +- .../school_owner_welcome_message.text.erb | 2 +- ...student_education_welcome_message.html.erb | 2 +- ...student_education_welcome_message.text.erb | 2 +- .../student_welcome_message.html.erb | 2 +- .../student_welcome_message.text.erb | 2 +- .../teacher_welcome_message.html.erb | 2 +- .../teacher_welcome_message.text.erb | 2 +- .../user_mailer/welcome_message.html.erb | 2 +- .../user_mailer/welcome_message.text.erb | 2 +- ruby/spec/support/utilities.rb | 4 +++ web/app/controllers/api_alerts_controller.rb | 35 ++++++++++++++++++- web/config/application.rb | 7 ++-- web/config/initializers/email.rb | 4 +-- web/config/routes.rb | 1 + 42 files changed, 96 insertions(+), 38 deletions(-) create mode 100644 ruby/lib/jam_ruby/app/mailers/mailer_helper.rb diff --git a/admin/config/application.rb b/admin/config/application.rb index fe6230fea..9e89690ac 100644 --- a/admin/config/application.rb +++ b/admin/config/application.rb @@ -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 diff --git a/ruby/lib/jam_ruby.rb b/ruby/lib/jam_ruby.rb index 147439ffd..fae069679 100755 --- a/ruby/lib/jam_ruby.rb +++ b/ruby/lib/jam_ruby.rb @@ -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" diff --git a/ruby/lib/jam_ruby/app/mailers/admin_mailer.rb b/ruby/lib/jam_ruby/app/mailers/admin_mailer.rb index 4d6a50682..829d1f062 100644 --- a/ruby/lib/jam_ruby/app/mailers/admin_mailer.rb +++ b/ruby/lib/jam_ruby/app/mailers/admin_mailer.rb @@ -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] diff --git a/ruby/lib/jam_ruby/app/mailers/mailer_helper.rb b/ruby/lib/jam_ruby/app/mailers/mailer_helper.rb new file mode 100644 index 000000000..a030bf922 --- /dev/null +++ b/ruby/lib/jam_ruby/app/mailers/mailer_helper.rb @@ -0,0 +1,6 @@ +module MailerHelper + def sendgrid_substitute(arg1, arg2) + @vars = Hash.new unless @vars + @vars[arg1] = arg2[0] + end +end \ No newline at end of file diff --git a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb index 5f89ddf26..daa048f00 100644 --- a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb +++ b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb @@ -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" diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_dl_notrun.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_dl_notrun.html.erb index d863614d2..1ef5fbc24 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_dl_notrun.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_dl_notrun.html.erb @@ -1,6 +1,6 @@ <% provide(:title, @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. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_dl_notrun.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_dl_notrun.text.erb index c447c34fb..edf045c62 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_dl_notrun.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_dl_notrun.text.erb @@ -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. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_notdl.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_notdl.html.erb index f51140865..a50d882e9 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_notdl.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_notdl.html.erb @@ -1,6 +1,6 @@ <% provide(:title, @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. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_notdl.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_notdl.text.erb index 400697399..8a5f85ffd 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_notdl.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_notdl.text.erb @@ -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. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_run_notgear.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_run_notgear.html.erb index 5197d2484..04db3c2f4 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_run_notgear.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_run_notgear.html.erb @@ -1,6 +1,6 @@ <% provide(:title, @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, it’s very likely the tips in this article will help you get things set up and optimized so you can start playing online. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_run_notgear.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_run_notgear.text.erb index cf33bad6c..d44c0867d 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_run_notgear.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/client_run_notgear.text.erb @@ -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, it’s very likely the tips in this article will help you get things set up and optimized so you can start playing online. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/gear_notsess.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/gear_notsess.html.erb index 427b21784..b5d5c9859 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/gear_notsess.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/gear_notsess.html.erb @@ -1,6 +1,6 @@ <% provide(:title, @title) %> -

Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +

Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --

We noticed that you haven’t yet played in a JamKazam session with multiple musicians that lasted long enough to be productive or fun. Since that’s 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! diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/gear_notsess.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/gear_notsess.text.erb index 50fab9654..eeb397401 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/gear_notsess.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/gear_notsess.text.erb @@ -1,6 +1,6 @@ <%= @title %> -Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> -- We noticed that you haven’t yet played in a JamKazam session with multiple musicians that lasted long enough to be productive or fun. Since that’s 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! diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notconnect.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notconnect.html.erb index ec9ebaa20..4d99a012a 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notconnect.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notconnect.html.erb @@ -1,6 +1,6 @@ <% provide(:title, @title) %> -

Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +

Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --

We noticed that you haven’t 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. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notconnect.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notconnect.text.erb index f708d6b6b..c1ad6da83 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notconnect.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notconnect.text.erb @@ -1,6 +1,6 @@ <%= @title %> -Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> -- We noticed that you haven’t 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. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notinvite.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notinvite.html.erb index 21add2e32..aa61e0dd2 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notinvite.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notinvite.html.erb @@ -1,6 +1,6 @@ <% provide(:title, @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. It’s still very early in our company’s development, so we don’t 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. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notinvite.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notinvite.text.erb index 20f4a54ae..029b1b9e3 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notinvite.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notinvite.text.erb @@ -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. It’s still very early in our company’s development, so we don’t 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. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notlike.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notlike.html.erb index e9c3c4d03..73c2b74f8 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notlike.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notlike.html.erb @@ -1,6 +1,6 @@ <% provide(:title, @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! diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notlike.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notlike.text.erb index 37c4a7623..db8939d34 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notlike.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/reg_notlike.text.erb @@ -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! diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notgood.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notgood.html.erb index 2392b813f..9fd851735 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notgood.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notgood.html.erb @@ -1,6 +1,6 @@ <% provide(:title, @title) %> -

Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +

Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --

We noticed that you haven’t 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! diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notgood.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notgood.text.erb index 3b5715382..beaf2b9b4 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notgood.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notgood.text.erb @@ -1,6 +1,6 @@ <%= @title %> -Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> -- We noticed that you haven’t 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! diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notrecord.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notrecord.html.erb index 97d5f036d..a6c5528b2 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notrecord.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notrecord.html.erb @@ -1,6 +1,6 @@ <% provide(:title, @title) %> -

Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +

Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --

We noticed that you haven’t yet made a recording during any of your JamKazam sessions. Recordings are extra special on JamKazam because: diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notrecord.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notrecord.text.erb index 301bef449..2e6c281e1 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notrecord.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/progress_mailer/sess_notrecord.text.erb @@ -1,6 +1,6 @@ <%= @title %> -Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> -- We noticed that you haven’t yet made a recording during any of your JamKazam sessions. Recordings are extra special on JamKazam because: diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/education_owner_welcome_message.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/education_owner_welcome_message.html.erb index eadbf65a5..bd9a1d0ff 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/education_owner_welcome_message.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/education_owner_welcome_message.html.erb @@ -2,7 +2,7 @@ <% if !@user.anonymous? %> -

Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +

Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --

<% end %> diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/education_owner_welcome_message.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/education_owner_welcome_message.text.erb index b101fb88e..fea2aca73 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/education_owner_welcome_message.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/education_owner_welcome_message.text.erb @@ -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 diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/retailer_owner_welcome_message.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/retailer_owner_welcome_message.html.erb index bd71e888a..86d8af32f 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/retailer_owner_welcome_message.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/retailer_owner_welcome_message.html.erb @@ -2,7 +2,7 @@ <% if !@user.anonymous? %> -

Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +

Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --

<% end %> diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/retailer_owner_welcome_message.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/retailer_owner_welcome_message.text.erb index 4a13e9d0a..e5a2bd675 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/retailer_owner_welcome_message.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/retailer_owner_welcome_message.text.erb @@ -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. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.html.erb index 7df3b4c61..b7a86152a 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.html.erb @@ -2,7 +2,7 @@ <% if !@user.anonymous? %> -

Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +

Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --

<% end %> diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.text.erb index 771a82b03..c65613aa9 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.text.erb @@ -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. diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.html.erb index 10426f858..c4e027359 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.html.erb @@ -2,7 +2,7 @@ <% if !@user.anonymous? %> -

Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +

Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --

<% end %> diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.text.erb index b16eef375..082d9319b 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.text.erb @@ -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 diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_welcome_message.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_welcome_message.html.erb index ddbe24f42..1974e52d5 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_welcome_message.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_welcome_message.html.erb @@ -2,7 +2,7 @@ <% if !@user.anonymous? %> -

Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +

Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --

<% end %> diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_welcome_message.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_welcome_message.text.erb index b16eef375..082d9319b 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_welcome_message.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_welcome_message.text.erb @@ -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 diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_welcome_message.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_welcome_message.html.erb index 19b30626d..13c461c40 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_welcome_message.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_welcome_message.html.erb @@ -2,7 +2,7 @@ <% if !@user.anonymous? %> -

Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +

Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --

<% end %> diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_welcome_message.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_welcome_message.text.erb index d6989f28a..23f16ce70 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_welcome_message.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/teacher_welcome_message.text.erb @@ -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 diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.html.erb index f5b01b69f..ce830d39d 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.html.erb @@ -2,7 +2,7 @@ <% if !@user.anonymous? %> -

Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> -- +

Hello <%= @vars[EmailBatch::VAR_FIRST_NAME] %> --

<% end %> diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.text.erb index b5f52a69d..30524215b 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.text.erb @@ -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. diff --git a/ruby/spec/support/utilities.rb b/ruby/spec/support/utilities.rb index 91858a0db..e6a75f494 100644 --- a/ruby/spec/support/utilities.rb +++ b/ruby/spec/support/utilities.rb @@ -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 diff --git a/web/app/controllers/api_alerts_controller.rb b/web/app/controllers/api_alerts_controller.rb index c5bb7eed4..465a61f29 100644 --- a/web/app/controllers/api_alerts_controller.rb +++ b/web/app/controllers/api_alerts_controller.rb @@ -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 << "

User - #{current_user.name} - #{current_user.email}

" + end + + + #body << params.to_yaml + + body << "

" + body << "
"
+    body << JSON.pretty_generate(params["api_alert"])
+    body << "
" + AdminMailer.pretty({ to: Rails.application.config.bugs_alias, + subject:params[:subject] || subject, + body:body + }).deliver_now + + + render json: {}, :status => :ok + + end + + private + def header + "" + end + def footer + "" + end end diff --git a/web/config/application.rb b/web/config/application.rb index a39ab2d23..7cf699cbe 100644 --- a/web/config/application.rb +++ b/web/config/application.rb @@ -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' diff --git a/web/config/initializers/email.rb b/web/config/initializers/email.rb index 6a1a43359..37e8e8551 100644 --- a/web/config/initializers/email.rb +++ b/web/config/initializers/email.rb @@ -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 \ No newline at end of file +#SendgridToolkit.api_user = Rails.application.config.sendgrid_username +#SendgridToolkit.api_key = Rails.application.config.sendgrid_password \ No newline at end of file diff --git a/web/config/routes.rb b/web/config/routes.rb index 1814709ee..96b950479 100644 --- a/web/config/routes.rb +++ b/web/config/routes.rb @@ -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'