From bca4356e43365f64818a060492450cddfb836caf Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 9 Sep 2016 09:06:02 -0500 Subject: [PATCH] many school fixes --- ruby/lib/jam_ruby/app/mailers/user_mailer.rb | 17 +++ ...student_education_welcome_message.html.erb | 80 +++++++++++ ...student_education_welcome_message.text.erb | 57 ++++++++ .../student_welcome_message.html.erb | 125 +++++++++++------- ruby/lib/jam_ruby/models/user.rb | 7 +- ruby/spec/mailers/render_emails_spec.rb | 2 + .../AccountSchoolScreen.js.jsx.coffee | 3 +- .../InviteSchoolUserDialog.js.jsx.coffee | 2 +- .../SchoolStudentLandingPage.js.jsx.coffee | 40 +++--- .../SchoolTeacherLandingPage.js.jsx.coffee | 4 +- 10 files changed, 269 insertions(+), 68 deletions(-) create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.text.erb diff --git a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb index 602afeab0..0ea5a7940 100644 --- a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb +++ b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb @@ -49,6 +49,23 @@ module JamRuby end end + def student_education_welcome_message(user) + @user = user + @subject = "Welcome to JamKazam and JamClass online lessons!" + @education = user.school && user.school.education + 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 student_welcome_message(user) @user = user @subject = "Welcome to JamKazam and JamClass online lessons!" 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 new file mode 100644 index 000000000..10426f858 --- /dev/null +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.html.erb @@ -0,0 +1,80 @@ +<% provide(:title, @subject) %> + + +<% if !@user.anonymous? %> +

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

+<% end %> + +<% if @education %> +

+ 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 studio quality audio from different locations over the Internet, and for delivering amazing online music lessons. +

+

+ To get ready to take JamClass lessons online, here are the things you'll want to do: +

+ +

1. Set Up Your Gear
+ When you sign up, someone from JamKazam will get in touch with you via email within a couple of business days to help you get set up. If you don't hear from us within a couple of days, please email us at support@jamkazam.com or call us at 1-877-376-8742. To play in online lessons, you will need at a minimum: (1) a Windows or Mac computer; (2) normal home Internet service; and (3) a pair of headphones or earbuds you can plug into the headphone minijack on your computer. If you would like to benefit from studio quality audio (recommended) in your lessons, JamKazam offers an amazing audio package for just $49.99 (less than our cost) that includes an audio interface (a little box that connects to your computer via USB cable), a microphone, a mic cable, and a mic stand. We'll discuss these options with you, and we're happy to support you whichever path you choose. We'll help step you through the setup process, and we'll even get into an online session with you to make sure everything is working properly, and to show you some of the key features you can use during online lessons. + +

+ +

2. Book Lessons
+ Once your gear is set up, you are ready to take lessons. Go to this web page: <%= @user.school.teacher_list_url %>. If your school has preferred instructors, they will be listed on this page, and you can click a button to book a lesson with the teacher from whom you want to take lessons. If your school doesn't have preferred instructors, then there is a link on this page to use our teacher search feature to find a great instructor from our broader community of teachers. You'll need your parents to enter credit card information to pay for your lessons. We use one of the largest and most secure commerce platforms on the Internet called Stripe, so you can feel confident your financial information will be very secure. +

+ +

3. Learn About JamClass Features
+ You can also review our JamClass user guide for students + to familiarize yourself with the features and resources available to you through our JamClass lesson service. This includes how to join your teacher in online lessons, features you can use while in lessons, and more. +

+ +

+ Again, welcome to JamKazam and our JamClass online music lesson service, and we look forward to helping you learn and grow as a musician! +

+<% else %> + + +

+ 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 + Internet. Unlike other lesson services, this means we can deliver a massively better online music lesson experience + than voice/chat apps like Skype, etc. Our rapidly growing community of <%= APP_CONFIG.musician_count %> musicians will attest to this. +

+ +

+ To get ready to take JamClass lessons online, here are the things you'll want to do: +

+ +

1. Find a Teacher & Book Lessons
+ + If you haven't done so already, use this link to search our teachers, and click to book a TestDrive with a teacher who looks good for you. When you do this, you'll be given the option to take full 30-minute TestDrive lessons: + +

+

+ Pick whichever option you prefer. TestDrive lets you safely and easily try multiple teachers to find the one who is best specifically for you, which is a great way to maximize the benefit from your lessons. And TestDrive lessons are heavily discounted to give you a risk-free way to get started. We'd suggest scheduling your first lesson for about a week in the future to give you plenty of time to get up and running with our free app. +

+

+ +

2. Set Up Your Gear
+ Please review our help articles on gear recommendations + to make sure you have everything you need to get set up properly for best results in your online lessons. + If you have everything you need, then you can follow the instructions on our setup help articles to download and install our free app and set it up with your audio gear and webcam. Please email us at support@jamkazam.com or call us at 1-877-376-8742 any time so that we can help you with these steps. We are very happy to help, and we also strongly suggest that you let one of our staff get into an online session with you to make sure everything is working properly and to make sure you're comfortable with the app and ready for your first lesson. +

+ +

3. Learn About JamClass Features
+ Please review our JamClass user guide for students to familiarize yourself with the features and resources available to you through our JamClass lesson service. This includes how to search for the best teacher for you, how to request/book lessons, how to join your teacher in online lessons, features you can use while in lessons, and much more. +

+ +

+ + Again, welcome to JamKazam and our JamClass online music lesson service, and we look forward to helping you learn and grow as a musician! +

+ +<% end %> + +

Best Regards,
+ Team JamKazam

\ No newline at end of file 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 new file mode 100644 index 000000000..b16eef375 --- /dev/null +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/student_education_welcome_message.text.erb @@ -0,0 +1,57 @@ +<% if !@user.anonymous? %>Hello <%= EmailBatchProgression::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 +Internet. Unlike other lesson services, this means we can deliver a massively better online music lesson experience +than voice/chat apps like Skype, etc. Our rapidly growing community of <%= APP_CONFIG.musician_count %> musicians will attest to this. + + +To get ready to take JamClass lessons online, here are the things you'll want to do: + +1. Find a Teacher & Book Lessons +If you already know the teacher from whom you want to learn, then you can simply +use this link to search for them (https://www.jamkazam.com/client#/jamclass/searchOptions), and +click the Book Lesson button to get started. But if you're like most of us, you don't know. In this case, we strongly +advise signing up for our unique TestDrive service. + +TestDrive lets you take 4 full lessons (30 minutes each) from 4 different teachers for just $49.99 to find the best +teacher for you. Finding the right teacher is the single most important determinant of success in your lessons. Would +you marry the first person you ever dated? No? Same here. Pick 4 teachers who look great, and then see who you click +with. It's a phenomenal value, and then you can stick with the best teacher for you. +Click this link to sign up now for TestDrive (https://www.jamkazam.com/client#/jamclass/test-drive-selection). +Then you can book 4 TestDrive lessons to get rolling. + +2. Set Up Your Gear +Use this link to a set of +help articles on how to set up your gear (https://jamkazam.desk.com/customer/en/portal/topics/673197-first-time-setup/articles) +to be ready to teach online. After you have signed +up, someone from JamKazam will contact you to schedule a test online session, in which we will make sure your audio +and video gear are working properly in an online session, and to make sure you feel comfortable with the key features +you will be using in sessions with teachers. + +3. Learn About JamClass Features +Use this link to a set of help articles for students on JamClass (https://jamkazam.desk.com/customer/en/portal/topics/926073-jamclass-online-music-lessons---for-students/articles) +to familiarize yourself with the most useful features +for online lessons. This includes how to search for the best teacher for you, how to request/book lessons, how to join +your teacher in online lessons, features you can use while in lessons, and much more. There is very important basic +information, plus some really nifty stuff here, so be sure to look through it at least briefly to see how we can +turbocharge your online lessons! + +4. Play With Other Musicians Online - It's Free! +With JamKazam, you can use the things you're learning in lessons to play with other amateur musicians in online +sessions, free! Or just play for fun. Once you've set up your gear for lessons, you can +create online music sessions (https://jamkazam.desk.com/customer/en/portal/articles/1599977-creating-a-session) +that others can join, or find other musicians' online music sessions (https://jamkazam.desk.com/customer/en/portal/articles/1599978-finding-a-session) +and hop into those to play with others. If you +want to take advantage of this part of the JamKazam platform, we'd advise that you edit your musician profile (https://www.jamkazam.com/client#/account/profile) to make +it easier to connect with other musicians (https://jamkazam.desk.com/customer/en/portal/articles/1707418-connecting-with-other-musicians) in our community to expand your set of musician friends. It's a ton of fun, +so give it a try! + +As you work through these things, if you ever get stuck or have questions, please don't hesitate to reach out for +help. You can email us any time at support@jamkazam.com. We are happy to +help you, and we look forward to helping you +learn and grow as a musician, and expand your musical universe! + +Best Regards, +Team JamKazam + 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 10426f858..ddbe24f42 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 @@ -7,47 +7,61 @@ <% end %> <% if @education %> +

- 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 studio quality audio from different locations over the Internet, and for delivering amazing online music lessons. + Thank you for expressing an interest in taking private music lessons online using JamKazam! A member of our staff + will reach out to you shortly to chat with you and answer any questions you have about how our online music lesson + service works, to help you determine if this is a good option for you.

+

+ If you decide online lessons look good, then we'll help you get your gear set up properly, and we'll even get into a + sample online session with you to make sure everything is working properly, and to ensure you are comfortable using + our app's features in a lesson. +

+ +

To take online lessons on JamKazam, you'll need the following things at home:

+ + + +

+ For higher quality audio in online sessions, we recommend (this is an option, not a requirement) a premium audio + gear bundle that includes an audio interface (a little box you connect to your computer with a USB cable), a + microphone, a mic cable, and a mic stand. We offer this package for just $49.99, which is less than our cost for + these products, but it makes a big difference in audio quality, so we think it's worth the upgrade. +

+ +

+ If you are curious to learn more about how everything works, you can also review our + help + guide for students. Thanks + again for connecting with us, and we look forward to speaking with you soon! +

+ +<% else %> + + +

+ 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 + Internet. Unlike other lesson services, this means we can deliver a massively better online music lesson experience + than voice/chat apps like Skype, etc. Our rapidly growing community of <%= APP_CONFIG.musician_count %> musicians + will attest to this. +

+

To get ready to take JamClass lessons online, here are the things you'll want to do:

-

1. Set Up Your Gear
- When you sign up, someone from JamKazam will get in touch with you via email within a couple of business days to help you get set up. If you don't hear from us within a couple of days, please email us at support@jamkazam.com or call us at 1-877-376-8742. To play in online lessons, you will need at a minimum: (1) a Windows or Mac computer; (2) normal home Internet service; and (3) a pair of headphones or earbuds you can plug into the headphone minijack on your computer. If you would like to benefit from studio quality audio (recommended) in your lessons, JamKazam offers an amazing audio package for just $49.99 (less than our cost) that includes an audio interface (a little box that connects to your computer via USB cable), a microphone, a mic cable, and a mic stand. We'll discuss these options with you, and we're happy to support you whichever path you choose. We'll help step you through the setup process, and we'll even get into an online session with you to make sure everything is working properly, and to show you some of the key features you can use during online lessons. +

1. Find a Teacher & Book Lessons
-

- -

2. Book Lessons
- Once your gear is set up, you are ready to take lessons. Go to this web page: <%= @user.school.teacher_list_url %>. If your school has preferred instructors, they will be listed on this page, and you can click a button to book a lesson with the teacher from whom you want to take lessons. If your school doesn't have preferred instructors, then there is a link on this page to use our teacher search feature to find a great instructor from our broader community of teachers. You'll need your parents to enter credit card information to pay for your lessons. We use one of the largest and most secure commerce platforms on the Internet called Stripe, so you can feel confident your financial information will be very secure. -

- -

3. Learn About JamClass Features
- You can also review our JamClass user guide for students - to familiarize yourself with the features and resources available to you through our JamClass lesson service. This includes how to join your teacher in online lessons, features you can use while in lessons, and more. -

- -

- Again, welcome to JamKazam and our JamClass online music lesson service, and we look forward to helping you learn and grow as a musician! -

-<% else %> - - -

- 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 - Internet. Unlike other lesson services, this means we can deliver a massively better online music lesson experience - than voice/chat apps like Skype, etc. Our rapidly growing community of <%= APP_CONFIG.musician_count %> musicians will attest to this. -

- -

- To get ready to take JamClass lessons online, here are the things you'll want to do: -

- -

1. Find a Teacher & Book Lessons
- - If you haven't done so already, use this link to search our teachers, and click to book a TestDrive with a teacher who looks good for you. When you do this, you'll be given the option to take full 30-minute TestDrive lessons: + If you haven't done so already, + use this link to search our + teachers, and click to book a TestDrive with a teacher who looks good for you. When you do this, you'll be + given the option to take full 30-minute TestDrive lessons:

- Pick whichever option you prefer. TestDrive lets you safely and easily try multiple teachers to find the one who is best specifically for you, which is a great way to maximize the benefit from your lessons. And TestDrive lessons are heavily discounted to give you a risk-free way to get started. We'd suggest scheduling your first lesson for about a week in the future to give you plenty of time to get up and running with our free app. + Pick whichever option you prefer. TestDrive lets you safely and easily try multiple teachers to find the one who is + best specifically for you, which is a great way to maximize the benefit from your lessons. And TestDrive lessons are + heavily discounted to give you a risk-free way to get started. We'd suggest scheduling your first lesson for about a + week in the future to give you plenty of time to get up and running with our free app. +

-

-

2. Set Up Your Gear
- Please review our help articles on gear recommendations - to make sure you have everything you need to get set up properly for best results in your online lessons. - If you have everything you need, then you can follow the instructions on our setup help articles to download and install our free app and set it up with your audio gear and webcam. Please email us at support@jamkazam.com or call us at 1-877-376-8742 any time so that we can help you with these steps. We are very happy to help, and we also strongly suggest that you let one of our staff get into an online session with you to make sure everything is working properly and to make sure you're comfortable with the app and ready for your first lesson. -

+

2. Set Up Your Gear
+ Please review our + help + articles on gear recommendations + to make sure you have everything you need to get set up properly for best results in your online lessons. + If you have everything you need, then you can follow the instructions on our + setup + help articles to download and install our free app and set it up with your audio gear and webcam. Please email + us at support@jamkazam.com or call us at + 1-877-376-8742 any time so that we can help you with these steps. + We are very happy to help, and we also strongly suggest that you let one of our staff get into an online session + with you to make sure everything is working properly and to make sure you're comfortable with the app and ready for + your first lesson. +

-

3. Learn About JamClass Features
- Please review our JamClass user guide for students to familiarize yourself with the features and resources available to you through our JamClass lesson service. This includes how to search for the best teacher for you, how to request/book lessons, how to join your teacher in online lessons, features you can use while in lessons, and much more. -

+

3. Learn About JamClass Features
+ Please review our + JamClass + user guide for students to familiarize yourself with the features and resources available to you through our + JamClass lesson service. This includes how to search for the best teacher for you, how to request/book lessons, how + to join your teacher in online lessons, features you can use while in lessons, and much more. +

-

+

- Again, welcome to JamKazam and our JamClass online music lesson service, and we look forward to helping you learn and grow as a musician! -

+ Again, welcome to JamKazam and our JamClass online music lesson service, and we look forward to helping you learn + and grow as a musician! +

<% end %> diff --git a/ruby/lib/jam_ruby/models/user.rb b/ruby/lib/jam_ruby/models/user.rb index 039535342..83e4ab5eb 100644 --- a/ruby/lib/jam_ruby/models/user.rb +++ b/ruby/lib/jam_ruby/models/user.rb @@ -274,6 +274,7 @@ module JamRuby if owned_school.nil? school = School.new school.user = self + school.education = education_interest school.save! end end @@ -1400,7 +1401,11 @@ module JamRuby user.handle_test_drive_package(test_drive_package, test_drive_package_details) if test_drive_package if user.is_a_student - UserMailer.student_welcome_message(user).deliver_now + #if school && school.education + # UserMailer.student_education_welcome_message(user).deliver_now + #else + UserMailer.student_welcome_message(user).deliver_now + #end elsif user.is_a_teacher UserMailer.teacher_welcome_message(user).deliver_now elsif user.education_interest diff --git a/ruby/spec/mailers/render_emails_spec.rb b/ruby/spec/mailers/render_emails_spec.rb index 9fa0dbff1..0ea998699 100644 --- a/ruby/spec/mailers/render_emails_spec.rb +++ b/ruby/spec/mailers/render_emails_spec.rb @@ -7,6 +7,7 @@ require "spec_helper" describe "RenderMailers", :slow => true do let(:user) { FactoryGirl.create(:user) } + let(:school) {FactoryGirl.create(:school, education:true)} before(:each) do @filename = nil # set this on your test to pin the filename; i just make it the name of the mailer method responsible for sending the mail @@ -27,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="student_welcome_message_education"; user.school = school; user.save!; 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 } diff --git a/web/app/assets/javascripts/react-components/AccountSchoolScreen.js.jsx.coffee b/web/app/assets/javascripts/react-components/AccountSchoolScreen.js.jsx.coffee index 73dc99586..838d5d8c7 100644 --- a/web/app/assets/javascripts/react-components/AccountSchoolScreen.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/AccountSchoolScreen.js.jsx.coffee @@ -215,7 +215,8 @@ profileUtils = context.JK.ProfileUtils
- {user.name} + {user.name}
+ {user.email}
remove from school diff --git a/web/app/assets/javascripts/react-components/InviteSchoolUserDialog.js.jsx.coffee b/web/app/assets/javascripts/react-components/InviteSchoolUserDialog.js.jsx.coffee index ff6969219..50eaf7610 100644 --- a/web/app/assets/javascripts/react-components/InviteSchoolUserDialog.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/InviteSchoolUserDialog.js.jsx.coffee @@ -177,7 +177,7 @@ I'm writing to make you aware of a very interesting new option for private music if !school? return `
no school
` - if school.education + if school.education && !@state.teacher @renderEducation() else @renderSchool() diff --git a/web/app/assets/javascripts/react-components/landing/SchoolStudentLandingPage.js.jsx.coffee b/web/app/assets/javascripts/react-components/landing/SchoolStudentLandingPage.js.jsx.coffee index 05a033f1b..fa99b6e2f 100644 --- a/web/app/assets/javascripts/react-components/landing/SchoolStudentLandingPage.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/landing/SchoolStudentLandingPage.js.jsx.coffee @@ -40,7 +40,7 @@ rest = context.JK.Rest()
- +
@@ -54,11 +54,27 @@ rest = context.JK.Rest() -

+

We will not share your email.
See our privacy policy. -

+
` + if !this.props.school.education + explain = `

+ Please register here if you are currently a student with {this.props.school.name}, and if you plan to take + online music lessons from {this.props.school.name} using the JamKazam service. When you have registered, we + will + email you instructions to set up your profile, and we'll schedule a brief online training session to make sure + you are comfortable using the service and ready to go for your first online lesson. +

` + else + explain = `

+ Please register here if you are currently a student with {this.props.school.name}, and if you are interested in + taking online music lessons using JamKazam. When you have registered, someone from JamKazam will contact you to + answer any questions you have about our online lesson service, and to help you decide if this is service is a + good option for you. If it is, we'll help you get set up and ready to go, and will get into an online session to + make sure everything is working properly. +

` `
@@ -75,15 +91,8 @@ rest = context.JK.Rest()
-

- Please register here if you are currently a student with {this.props.school.name}, and if you plan to take - online music lessons from {this.props.school.name} using the JamKazam service. When you have registered, we - will - email you instructions to set up your profile, and we'll schedule a brief online training session to make sure - you are comfortable using the service and ready to go for your first online lesson. -

+ {explain}
- {register}
` @@ -106,12 +115,12 @@ rest = context.JK.Rest() loggedIn = context.JK.currentUserId? if loggedIn - #window.location.href = "/client#/jamclass" - window.location.href = "/client#/profile/#{context.JK.currentUserId}" + window.location.href = "/client#/home" + #window.location.href = "/client#/profile/#{context.JK.currentUserId}" else @createUser() - @setState({processing:true}) + @setState({processing: true}) createUser: () -> $form = $('.school-signup-form') @@ -139,8 +148,7 @@ rest = context.JK.Rest() else logger.debug("default post-login path"); - window.location.href = "/client#/profile/#{response.id}" - + window.location.href = "/client#/home" ).fail((jqXHR) => @setState({processing: false}) if jqXHR.status == 422 diff --git a/web/app/assets/javascripts/react-components/landing/SchoolTeacherLandingPage.js.jsx.coffee b/web/app/assets/javascripts/react-components/landing/SchoolTeacherLandingPage.js.jsx.coffee index a0138f3a1..f22f63463 100644 --- a/web/app/assets/javascripts/react-components/landing/SchoolTeacherLandingPage.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/landing/SchoolTeacherLandingPage.js.jsx.coffee @@ -54,9 +54,9 @@ rest = context.JK.Rest() -

+

We will not share your email.
See our privacy policy. -

+
`