various fixes for emails for second ed program

This commit is contained in:
Seth Call 2016-09-08 18:06:04 -05:00
parent 222b9ea9c6
commit 2173a8821d
12 changed files with 110 additions and 3 deletions

View File

@ -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

View File

@ -365,4 +365,5 @@ nullable_user_id_jamblaster.sql
rails4_migration.sql
non_free_jamtracks.sql
retailers.sql
second_ed.sql
second_ed.sql
second_ed_v2.sql

1
db/up/second_ed_v2.sql Normal file
View File

@ -0,0 +1 @@
ALTER TABLE users ADD COLUMN education_interest BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -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

View File

@ -0,0 +1,36 @@
<% provide(:title, @subject) %>
<% if !@user.anonymous? %>
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
</p>
<% end %>
<p>
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.
</p>
<p>
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
<a href="https://jamkazam.desk.com/customer/en/portal/topics/985544-jamclass-online-music-lessons---for-secondary-education-music-program-directors/articles" style="color:#fc0">help
articles for music program directors</a>. 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.
</p>
<p>
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 <a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/topics/926073-jamclass-online-music-lessons---for-students/articles">help guide for students</a> and our <a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/topics/926076-jamclass-online-music-lessons---for-teachers/articles">help guide for teachers</a>.
</p>
<p>
Thanks again for connecting with us, and we look forward to speaking with you soon!
</p>
<p>Best Regards,<br/>
Team JamKazam</p>

View File

@ -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

View File

@ -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

View File

@ -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 }

View File

@ -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'

View File

@ -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]

View File

@ -169,6 +169,7 @@
<div class="right">
<a id="account-affiliate-partner-link" href="#" class="button-orange">VIEW</a>
</div>
<br clear="all" />
{% } else { %}
<div class="account-mid affiliate">
<div class="whitespace">

View File

@ -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