diff --git a/admin/app/admin/interested_education.rb b/admin/app/admin/interested_education.rb new file mode 100644 index 000000000..cdd9eede0 --- /dev/null +++ b/admin/app/admin/interested_education.rb @@ -0,0 +1,20 @@ +ActiveAdmin.register JamRuby::User, :as => 'EducationInterest' do + + menu :label => 'Interested in Education', :parent => 'JamClass' + + config.sort_order = 'created_at desc' + config.batch_actions = false + config.per_page = 100 + config.paginate = true + config.filters = false + + scope("All", default: true) { |scope| scope.where(education_interest: true) } + + index do + column "Name" do |user| + span do + link_to "#{user.name} (#{user.email})", "#{Rails.application.config.external_root_url}/client#/profile/#{user.id}" + end + end + end +end \ No newline at end of file diff --git a/db/manifest b/db/manifest index e229d8d59..66532119f 100755 --- a/db/manifest +++ b/db/manifest @@ -365,4 +365,5 @@ nullable_user_id_jamblaster.sql rails4_migration.sql non_free_jamtracks.sql retailers.sql -second_ed.sql \ No newline at end of file +second_ed.sql +second_ed_v2.sql \ No newline at end of file diff --git a/db/up/second_ed_v2.sql b/db/up/second_ed_v2.sql new file mode 100644 index 000000000..a520116e9 --- /dev/null +++ b/db/up/second_ed_v2.sql @@ -0,0 +1 @@ +ALTER TABLE users ADD COLUMN education_interest BOOLEAN NOT NULL DEFAULT FALSE; \ 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 dc4c31eac..602afeab0 100644 --- a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb +++ b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb @@ -100,6 +100,21 @@ module JamRuby format.html end end + def education_owner_welcome_message(user) + @user = user + @subject= "Welcome to JamKazam and JamClass online lessons!" + sendgrid_category "Welcome" + sendgrid_unique_args :type => "welcome_message" + + sendgrid_recipients([user.email]) + sendgrid_substitute('@USERID', [user.id]) + sendgrid_substitute(EmailBatchProgression::VAR_FIRST_NAME, [user.first_name]) + + mail(:to => user.email, :subject => @subject) do |format| + format.text + format.html + end + end def password_changed(user) @user = user 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 new file mode 100644 index 000000000..eadbf65a5 --- /dev/null +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/education_owner_welcome_message.html.erb @@ -0,0 +1,36 @@ +<% provide(:title, @subject) %> + + +<% if !@user.anonymous? %> +

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

+<% end %> + +

+ Thank you for expressing an interest in exploring our secondary education partner program! A member of our staff will + reach out to you shortly to chat with you and answer any questions you have about our partner program, our + technologies, and how we can help you continue to deliver the best possible music education to your students. +

+ +

+ It takes less than 1 hour of your time to set up your music program to partner with JamKazam. And we are happy to walk + you through the process step by step, so you don't have to worry about figuring out how to do this. But if you're + curious, then you can check out our + help + articles for music program directors. These help articles explain things from + the perspective of the school program director - e.g. how to set up your school, how to invite teachers and students + to sign up if they wish, how distributions are made into your booster fund, and so on. +

+ + +

+ JamKazam handles all the technical support needed to help your students, as well as any preferred teachers associated + with your music program, to get set up and ready to go. We even get into a sample online session with each individual + to make sure everything is working, and to show them around the features they'll use in online lessons. But if you are + curious about how it all works, you can also review our help guide for students and our help guide for teachers. +

+

+ Thanks again for connecting with us, and we look forward to speaking with you soon! +

+

Best Regards,
+ Team JamKazam

\ No newline at end of file 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 new file mode 100644 index 000000000..b101fb88e --- /dev/null +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/education_owner_welcome_message.text.erb @@ -0,0 +1,21 @@ +<% if !@user.anonymous? %> + Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> +<% end %> + +Thank you for expressing an interest in exploring our secondary education partner program! A member of our staff will +reach out to you shortly to chat with you and answer any questions you have about our partner program, our +technologies, and how we can help you continue to deliver the best possible music education to your students. + +It takes less than 1 hour of your time to set up your music program to partner with JamKazam. And we are happy to walk +you through the process step by step, so you don't have to worry about figuring out how to do this. But if you're +curious, then you can check out our help articles for music program directors -- https://jamkazam.desk.com/customer/en/portal/topics/985544-jamclass-online-music-lessons---for-secondary-education-music-program-directors/articles. These help articles explain things from +the perspective of the school program director - e.g. how to set up your school, how to invite teachers and students +to sign up if they wish, how distributions are made into your booster fund, and so on. + +JamKazam handles all the technical support needed to help your students, as well as any preferred teachers associated +with your music program, to get set up and ready to go. We even get into a sample online session with each individual +to make sure everything is working, and to show them around the features they'll use in online lessons. But if you are +curious about how it all works, you can also review our help guide for students -- https://jamkazam.desk.com/customer/en/portal/topics/926073-jamclass-online-music-lessons---for-students/articles and our help + guide for teachers -- https://jamkazam.desk.com/customer/en/portal/topics/926076-jamclass-online-music-lessons---for-teachers/articles. +Best Regards, +Team JamKazam \ No newline at end of file diff --git a/ruby/lib/jam_ruby/models/user.rb b/ruby/lib/jam_ruby/models/user.rb index 7b098b08c..039535342 100644 --- a/ruby/lib/jam_ruby/models/user.rb +++ b/ruby/lib/jam_ruby/models/user.rb @@ -266,7 +266,11 @@ module JamRuby def after_save if school_interest && !school_interest_was - AdminMailer.partner({body: "#{email} signed up via the https://www.jamkazam.com/landing/jamclass/schools page.\n\nFull list is here: https://www.jamkazam.com/admin/admin/school_interests", subject: "#{email} is interested in schools"}).deliver_now + if education_interest + AdminMailer.partner({body: "#{email} signed up via the https://www.jamkazam.com/landing/jamclass/education page.\n\nFull list is here: https://www.jamkazam.com/admin/admin/education_interests", subject: "#{email} is interested in education"}).deliver_now + else + AdminMailer.partner({body: "#{email} signed up via the https://www.jamkazam.com/landing/jamclass/schools page.\n\nFull list is here: https://www.jamkazam.com/admin/admin/school_interests", subject: "#{email} is interested in schools"}).deliver_now + end if owned_school.nil? school = School.new school.user = self @@ -1132,6 +1136,7 @@ module JamRuby school_invitation_code = options[:school_invitation_code] school_id = options[:school_id] school_interest = options[:school_interest] + education_interest = options[:education_interest] origin = options[:origin] test_drive_package_details = options[:test_drive_package] @@ -1164,6 +1169,7 @@ module JamRuby user.is_a_student = !!student user.is_a_teacher = !!teacher user.school_interest = !!school_interest + user.education_interest = !!education_interest if user.is_a_student || user.is_a_teacher musician = true end @@ -1397,6 +1403,8 @@ module JamRuby UserMailer.student_welcome_message(user).deliver_now elsif user.is_a_teacher UserMailer.teacher_welcome_message(user).deliver_now + elsif user.education_interest + UserMailer.education_owner_welcome_message(user).deliver_now elsif user.school_interest UserMailer.school_owner_welcome_message(user).deliver_now else diff --git a/ruby/spec/mailers/render_emails_spec.rb b/ruby/spec/mailers/render_emails_spec.rb index 8166798da..9fa0dbff1 100644 --- a/ruby/spec/mailers/render_emails_spec.rb +++ b/ruby/spec/mailers/render_emails_spec.rb @@ -28,6 +28,7 @@ describe "RenderMailers", :slow => true do it { @filename="welcome_message"; UserMailer.welcome_message(user).deliver_now } it { @filename="student_welcome_message"; UserMailer.student_welcome_message(user).deliver_now } it { @filename="school_owner_welcome_message"; UserMailer.school_owner_welcome_message(user).deliver_now } + it { @filename="education_owner_welcome_message"; UserMailer.education_owner_welcome_message(user).deliver_now } it { @filename="confirm_email"; UserMailer.confirm_email(user, "/signup").deliver_now } it { @filename="password_reset"; UserMailer.password_reset(user, '/reset_password').deliver_now } it { @filename="password_changed"; UserMailer.password_changed(user).deliver_now } diff --git a/web/app/assets/javascripts/react-components/landing/JamClassEducationLandingPage.js.jsx.coffee b/web/app/assets/javascripts/react-components/landing/JamClassEducationLandingPage.js.jsx.coffee index df2df6627..3a71525d6 100644 --- a/web/app/assets/javascripts/react-components/landing/JamClassEducationLandingPage.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/landing/JamClassEducationLandingPage.js.jsx.coffee @@ -154,7 +154,7 @@ rest = context.JK.Rest() last_name: null, terms: terms, school_interest: true, - education: true + education_interest: true }) .done((response) => context.location = '/client#/home' diff --git a/web/app/controllers/api_users_controller.rb b/web/app/controllers/api_users_controller.rb index 00f7a8d57..c91520df0 100644 --- a/web/app/controllers/api_users_controller.rb +++ b/web/app/controllers/api_users_controller.rb @@ -99,6 +99,7 @@ class ApiUsersController < ApiController school_invitation_code: params[:school_invitation_code], school_id: params[:school_id], school_interest: params[:school_interest], + education_interest: params[:education_interest], affiliate_referral_id: cookies[:affiliate_visitor], origin: origin_cookie, test_drive_package: params[:test_drive_package] diff --git a/web/app/views/clients/_account.html.erb b/web/app/views/clients/_account.html.erb index dfb771e4d..e0f52a819 100644 --- a/web/app/views/clients/_account.html.erb +++ b/web/app/views/clients/_account.html.erb @@ -169,6 +169,7 @@
VIEW
+
{% } else { %}
diff --git a/web/lib/user_manager.rb b/web/lib/user_manager.rb index f3044c312..48062d2cf 100644 --- a/web/lib/user_manager.rb +++ b/web/lib/user_manager.rb @@ -35,6 +35,7 @@ class UserManager < BaseManager school_invitation_code = options[:school_invitation_code] school_id = options[:school_id] school_interest = options[:school_interest] + education_interest = options[:education_interest] origin = options[:origin] test_drive_package = options[:test_drive_package] @@ -87,6 +88,7 @@ class UserManager < BaseManager school_invitation_code: school_invitation_code, school_id: school_id, school_interest: school_interest, + education_interest: education_interest, origin: origin, test_drive_package: test_drive_package) user