update email for amazon users

This commit is contained in:
Seth Call 2017-10-15 17:07:35 -05:00
parent 21c294de59
commit 175d6d458e
8 changed files with 66 additions and 3 deletions

View File

@ -1 +1,2 @@
ALTER TABLE users ADD COLUMN under_13 BOOLEAN; ALTER TABLE users ADD COLUMN under_13 BOOLEAN;
ALTER TABLE users ADD COLUMN via_amazon BOOLEAN;

View File

@ -66,6 +66,22 @@ module JamRuby
end end
end end
def amazon_welcome_message(user)
@user = user
@subject = "Your 2 free music 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 student_welcome_message(user) def student_welcome_message(user)
@user = user @user = user
@subject = "Welcome to JamKazam and JamClass online lessons!" @subject = "Welcome to JamKazam and JamClass online lessons!"

View File

@ -0,0 +1,18 @@
<p>
Welcome to JamKazam, and congratulations on the purchase of your new guitar or bass from Amazon!
</p>
<p>
Connecting with a world-class instructor is the best way to learn to play an instrument. Your instructor will guide you based on your unique goals, make sure youre doing things correctly to build a solid foundation, and maximize your musical growth from your investment of time.
</p>
<p>JamKazam has attracted a community of world-class instructors and has built a truly unique technology platform that lets students and instructors learn and play together over the Internet from the comfort and convenience of home.</p>
<p>
Within a day or two, one of our support team members will reach out to you via email to help you get ready for your first lesson. We provide free and highly personalized 1:1 support to help you set up our app with audio and video, make sure everything is working properly, and get you comfortable with the features youll be using in your lessons.
</p>
<p>
Thanks again for joining our community of <%= APP_CONFIG.musician_count %> musicians and starting your musical journey with us! Well be in touch very soon.
</p>
<p>Best Regards,<br/>
Team JamKazam</p>

View File

@ -0,0 +1,14 @@
<% provide(:title, @subject) %>
Welcome to JamKazam, and congratulations on the purchase of your new guitar or bass from Amazon!
Connecting with a world-class instructor is the best way to learn to play an instrument. Your instructor will guide you based on your unique goals, make sure youre doing things correctly to build a solid foundation, and maximize your musical growth from your investment of time.
JamKazam has attracted a community of world-class instructors and has built a truly unique technology platform that lets students and instructors learn and play together over the Internet from the comfort and convenience of home.</p>
Within a day or two, one of our support team members will reach out to you via email to help you get ready for your first lesson. We provide free and highly personalized 1:1 support to help you set up our app with audio and video, make sure everything is working properly, and get you comfortable with the features youll be using in your lessons.
Thanks again for joining our community of <%= APP_CONFIG.musician_count %> musicians and starting your musical journey with us! Well be in touch very soon.
Best Regards,
Team JamKazam

View File

@ -48,6 +48,10 @@ module JamRuby
LessonPackageType.find(SINGLE_FREE) LessonPackageType.find(SINGLE_FREE)
end end
def is_amazon?
AMAZON_PACKAGES.include?(id)
end
def self.amazon_test_drive_free_4 def self.amazon_test_drive_free_4
LessonPackageType.find(AMAZON_TEST_DRIVE_FREE_4_ID) LessonPackageType.find(AMAZON_TEST_DRIVE_FREE_4_ID)
end end

View File

@ -38,6 +38,9 @@ module JamRuby
validate :must_be_activated validate :must_be_activated
validate :within_one_year validate :within_one_year
def is_amazon_posa_card?
lesson_package_type.is_amazon?
end
def is_lesson_posa_card? def is_lesson_posa_card?
self.is_lesson self.is_lesson
end end

View File

@ -1367,6 +1367,7 @@ module JamRuby
if posa_card if posa_card
posa_card.claim(user) posa_card.claim(user)
user.via_amazon = posa_card.is_amazon_posa_card?
user.posa_cards << posa_card user.posa_cards << posa_card
user.purchase_required = posa_card.requires_purchase # temporary; just so the signup page knows to send them to payment place user.purchase_required = posa_card.requires_purchase # temporary; just so the signup page knows to send them to payment place
else else
@ -1467,7 +1468,13 @@ module JamRuby
end end
AdminMailer.jamclass_alerts({subject: "#{user.email} just signed up as a student", body: body}).deliver_now AdminMailer.jamclass_alerts({subject: "#{user.email} just signed up as a student", body: body}).deliver_now
UserMailer.student_welcome_message(user).deliver_now if user.via_amazon
UserMailer.amazon_welcome_message(user).deliver_now
else
UserMailer.student_welcome_message(user).deliver_now
end
#end #end
elsif user.is_a_teacher elsif user.is_a_teacher
UserMailer.teacher_welcome_message(user).deliver_now UserMailer.teacher_welcome_message(user).deliver_now

View File

@ -448,7 +448,7 @@ if defined?(Bundler)
config.end_of_wait_window_forgiveness_minutes = 1 config.end_of_wait_window_forgiveness_minutes = 1
config.olark_enabled = true config.olark_enabled = true
config.jamclass_enabled = false config.jamclass_enabled = false
config.musician_count = '40,000+' config.musician_count = '75,000+'
config.jamblaster_menu = false config.jamblaster_menu = false
# Applications created before Rails 4.1 uses Marshal to serialize cookie values into the signed and encrypted cookie jars. # Applications created before Rails 4.1 uses Marshal to serialize cookie values into the signed and encrypted cookie jars.
# If you want to use the new JSON-based format in your application, you can add an initializer file with the following content: # If you want to use the new JSON-based format in your application, you can add an initializer file with the following content: