diff --git a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb
index 25e739518..ddf1c46d8 100644
--- a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb
+++ b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb
@@ -81,6 +81,22 @@ module JamRuby
end
end
+ def school_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/school_owner_welcome_message.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.html.erb
new file mode 100644
index 000000000..7df3b4c61
--- /dev/null
+++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.html.erb
@@ -0,0 +1,39 @@
+<% provide(:title, @subject) %>
+
+
+<% if !@user.anonymous? %>
+
Hello <%= EmailBatchProgression::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.
+
+
+
+ We'd also like to provide links to some help articles that explain how many things work, and will likely answer many of your questions in a well-organized manner:
+
+
+
+Guide for Music School Owners
+ These help articles explain things from the perspective of the school owner - e.g. how you can schedule and book lessons from our marketplace with your teachers, how billing and payments are handled, and so on.
+
+
+Guide for Music Lesson Teachers
+ These help articles explain how teachers use the features of the platform outside of the online lesson sessions.
+
+
+Key Features To Use In Online Sessions
+ These help articles explain the key features instructors can use in online sessions to teach effectively.
+
+
+
+ Gear Requirements
+ This help article explains the requirements for your computer, audio and video gear, and Internet service.
+
+
+
+ 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/school_owner_welcome_message.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.text.erb
new file mode 100644
index 000000000..771a82b03
--- /dev/null
+++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/school_owner_welcome_message.text.erb
@@ -0,0 +1,24 @@
+<% if !@user.anonymous? %>
+Hello <%= EmailBatchProgression::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.
+
+We'd also like to provide links to some help articles that explain how many things work, and will likely answer many of your questions in a well-organized manner:
+
+-- Guide for Music School Owners (https://jamkazam.desk.com/customer/en/portal/topics/935633-jamclass-online-music-lessons---for-music-schools/articles)
+These help articles explain things from the perspective of the school owner - e.g. how you can schedule and book lessons from our marketplace with your teachers, how billing and payments are handled, and so on.
+
+-- Guide for Music Lesson Teachers (https://jamkazam.desk.com/customer/en/portal/topics/926076-jamclass-online-music-lessons---for-teachers/articles)
+These help articles explain how teachers use the features of the platform outside of the online lesson sessions.
+
+-- Key Features To Use In Online Sessions (https://jamkazam.desk.com/customer/en/portal/topics/673198-key-features-to-use-in-online-sessions/articles)
+These help articles explain the key features instructors can use in online sessions to teach effectively.
+
+-- Gear Requirements (https://jamkazam.desk.com/customer/en/portal/articles/1288274-computer-internet-audio-and-video-requirements)
+This help article explains the requirements for your computer, audio and video gear, and Internet service.
+
+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/models/user.rb b/ruby/lib/jam_ruby/models/user.rb
index 08c985e9c..1b64de4f8 100644
--- a/ruby/lib/jam_ruby/models/user.rb
+++ b/ruby/lib/jam_ruby/models/user.rb
@@ -1324,13 +1324,11 @@ module JamRuby
if user.is_a_student
UserMailer.student_welcome_message(user).deliver
- end
-
- if user.is_a_teacher
+ elsif user.is_a_teacher
UserMailer.teacher_welcome_message(user).deliver
- end
-
- if !user.is_a_teacher && !user.is_a_student
+ elsif user.school_interest
+ UserMailer.school_owner_welcome_message(user).deliver
+ else
UserMailer.welcome_message(user).deliver
end
diff --git a/ruby/spec/mailers/render_emails_spec.rb b/ruby/spec/mailers/render_emails_spec.rb
index 659e172ac..7ef34fe58 100644
--- a/ruby/spec/mailers/render_emails_spec.rb
+++ b/ruby/spec/mailers/render_emails_spec.rb
@@ -27,6 +27,7 @@ describe "RenderMailers", :slow => true do
it { @filename="welcome_message"; UserMailer.welcome_message(user).deliver }
it { @filename="student_welcome_message"; UserMailer.student_welcome_message(user).deliver }
+ it { @filename="school_owner_welcome_message"; UserMailer.school_owner_welcome_message(user).deliver }
it { @filename="confirm_email"; UserMailer.confirm_email(user, "/signup").deliver }
it { @filename="password_reset"; UserMailer.password_reset(user, '/reset_password').deliver }
it { @filename="password_changed"; UserMailer.password_changed(user).deliver }
diff --git a/web/app/assets/javascripts/react-components/LessonPayment.js.jsx.coffee b/web/app/assets/javascripts/react-components/LessonPayment.js.jsx.coffee
index 00369f633..7de3cabb9 100644
--- a/web/app/assets/javascripts/react-components/LessonPayment.js.jsx.coffee
+++ b/web/app/assets/javascripts/react-components/LessonPayment.js.jsx.coffee
@@ -164,6 +164,7 @@ UserStore = context.UserStore
text: "Please refresh this page and try to enter your info again. Sorry for the inconvenience!"
})
else
+
if @reuseStoredCard()
@attemptPurchase(null)
else
@@ -227,12 +228,16 @@ UserStore = context.UserStore
exp_year: year,
}
+ @setState({updating: true})
+
window.Stripe.card.createToken(data, (status, response) => (@stripeResponseHandler(status, response)));
stripeResponseHandler: (status, response) ->
console.log("stripe response", JSON.stringify(response))
if response.error
+ @setState({updating: false})
+
if response.error.code == "invalid_number"
@setState({ccError: true, cvvError: null, expiryError: null})
else if response.error.code == "invalid_cvc"
@@ -263,9 +268,12 @@ UserStore = context.UserStore
if @state.shouldShowName
data.name = @root.find('#set-user-on-card').val()
+ @setState({updating: true})
rest.submitStripe(data).done((response) => @stripeSubmitted(response)).fail((jqXHR) => @stripeSubmitFailure(jqXHR))
stripeSubmitted: (response) ->
+ @setState({updating: false})
+
logger.debug("stripe submitted: " + JSON.stringify(response))
#if @state.shouldShowName