PLG feature for Test Session reminder emails

Implement the Test Session reminder emails VRFS-5646
This commit is contained in:
Nuwan 2025-07-24 18:58:47 +05:30
parent 9058c8af1d
commit b732442932
11 changed files with 254 additions and 5 deletions

View File

@ -0,0 +1,13 @@
class AddTestGearReminderColumnsToUsers < ActiveRecord::Migration
def self.up
execute "ALTER TABLE users ADD COLUMN test_gear_reminder1_sent_at TIMESTAMP"
execute "ALTER TABLE users ADD COLUMN test_gear_reminder2_sent_at TIMESTAMP"
execute "ALTER TABLE users ADD COLUMN test_gear_reminder3_sent_at TIMESTAMP"
end
def self.down
execute "ALTER TABLE users DROP COLUMN test_gear_reminder1_sent_at"
execute "ALTER TABLE users DROP COLUMN test_gear_reminder2_sent_at"
execute "ALTER TABLE users DROP COLUMN test_gear_reminder3_sent_at"
end
end

View File

@ -480,6 +480,30 @@ module JamRuby
end end
end end
def test_gear_reminder1(user)
@user = user
mail(:to => user.email, :subject => I18n.t('user_mailer.test_gear_reminder1.subject')) do |format|
format.text
format.html { render layout: "user_mailer_beta" }
end
end
def test_gear_reminder2(user)
@user = user
mail(:to => user.email, :subject => I18n.t('user_mailer.test_gear_reminder2.subject')) do |format|
format.text
format.html { render layout: "user_mailer_beta" }
end
end
def test_gear_reminder3(user)
@user = user
mail(:to => user.email, :subject => I18n.t('user_mailer.test_gear_reminder3.subject')) do |format|
format.text
format.html { render layout: "user_mailer_beta" }
end
end
def signup_survey(user) def signup_survey(user)
@user = user @user = user
@subject = I18n.t('user_mailer.signup_survey.subject') @subject = I18n.t('user_mailer.signup_survey.subject')

View File

@ -0,0 +1,26 @@
<p><%=I18n.t('user_mailer.test_gear_reminder1.greeting') -%> <%= @user.first_name -%> -</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph1').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph2').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph3').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph4').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph5').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder1.regards') -%>,<br />
<%=I18n.t('user_mailer.test_gear_reminder1.signature') -%>
</p>

View File

@ -0,0 +1,14 @@
<%=I18n.t('user_mailer.test_gear_reminder1.greeting') -%> <%= @user.first_name -%> -
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph1').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph2').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph3').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph4').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph5').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder1.regards') -%>,
<%=I18n.t('user_mailer.test_gear_reminder1.signature') -%>

View File

@ -0,0 +1,22 @@
<p><%=I18n.t('user_mailer.test_gear_reminder2.greeting') -%> <%= @user.first_name -%> -</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder2.paragraph1').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder2.paragraph2').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder2.paragraph3').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder2.paragraph4').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder2.regards') -%>,<br />
<%=I18n.t('user_mailer.test_gear_reminder2.signature') -%>
</p>

View File

@ -0,0 +1,12 @@
<%=I18n.t('user_mailer.test_gear_reminder2.greeting') -%> <%= @user.first_name -%> -
<%=I18n.t('user_mailer.test_gear_reminder2.paragraph1').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder2.paragraph2').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder2.paragraph3').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder2.paragraph4').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder2.regards') -%>,
<%=I18n.t('user_mailer.test_gear_reminder2.signature') -%>

View File

@ -0,0 +1,26 @@
<p><%=I18n.t('user_mailer.test_gear_reminder3.greeting') -%> <%= @user.first_name -%> -</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder3.paragraph1').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder3.paragraph2').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder3.paragraph3').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder3.paragraph4').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder3.paragraph5').html_safe -%>
</p>
<p>
<%=I18n.t('user_mailer.test_gear_reminder3.regards') -%>,<br />
<%=I18n.t('user_mailer.test_gear_reminder3.signature') -%>
</p>

View File

@ -0,0 +1,14 @@
<%=I18n.t('user_mailer.test_gear_reminder1.greeting') -%> <%= @user.first_name -%> -
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph1').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph2').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph3').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph4').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder1.paragraph5').html_safe -%>
<%=I18n.t('user_mailer.test_gear_reminder1.regards') -%>,
<%=I18n.t('user_mailer.test_gear_reminder1.signature') -%>

View File

@ -0,0 +1,44 @@
module JamRuby
class TestGearReminder
@@log = Logging.logger[TestGearReminder]
def self.send_reminders
begin
reminder1_users.find_each do |user|
UserMailer.test_gear_reminder1(user).deliver_now
User.where(id: user.id).update_all(test_gear_reminder1_sent_at: Time.now)
end
reminder2_users.find_each do |user|
UserMailer.test_gear_reminder2(user).deliver_now
User.where(id: user.id).update_all(test_gear_reminder2_sent_at: Time.now)
end
reminder3_users.find_each do |user|
UserMailer.test_gear_reminder3(user).deliver_now
User.where(id: user.id).update_all(test_gear_reminder3_sent_at: Time.now)
end
rescue Exception => e
@@log.error("unable to send gear setup reminder email #{e}")
puts "unable to send gear setup reminder email #{e}"
end
end
def self.prospect_users
User.where("users.first_music_session_at IS NULL")
end
def self.reminder1_users
TestGearReminder.prospect_users.where("users.first_certified_gear_at < ? AND users.test_gear_reminder1_sent_at IS NULL", 1.day.ago)
end
def self.reminder2_users
TestGearReminder.prospect_users.where("users.first_certified_gear_at < ? AND users.test_gear_reminder1_sent_at IS NOT NULL AND users.test_gear_reminder2_sent_at IS NULL", 3.days.ago)
end
def self.reminder3_users
TestGearReminder.prospect_users.where("users.first_certified_gear_at < ? AND users.test_gear_reminder2_sent_at IS NOT NULL AND users.test_gear_reminder3_sent_at IS NULL", 5.days.ago)
end
end
end

View File

@ -16,6 +16,7 @@ module JamRuby
EmailProfileReminder.send_reminders EmailProfileReminder.send_reminders
EmailSignupSurvey.send_survey EmailSignupSurvey.send_survey
GearSetupReminder.send_reminders GearSetupReminder.send_reminders
TestGearReminder.send_reminders
ConnectionManager.new.cleanup_dangling ConnectionManager.new.cleanup_dangling
@@log.info("done") @@log.info("done")

View File

@ -83,7 +83,6 @@ en:
paragraph4: "For next steps, dont forget you can always refer back to the Welcome email we sent you when you signed up. And if you run into any problems or get stuck, please send us email at support@jamkazam.com. Were always happy to help" paragraph4: "For next steps, dont forget you can always refer back to the Welcome email we sent you when you signed up. And if you run into any problems or get stuck, please send us email at support@jamkazam.com. Were always happy to help"
regards: "Best Regards," regards: "Best Regards,"
signature: "JamKazam Team" signature: "JamKazam Team"
profile_complete_reminder2: profile_complete_reminder2:
subject: "Complete your JamKazam profile" subject: "Complete your JamKazam profile"
greeting: "Hello" greeting: "Hello"
@ -92,7 +91,6 @@ en:
paragraph2: "For next steps after your profile, dont forget you can always refer back to the Welcome email we sent you when you signed up. And if you run into any problems or get stuck, please send us email at support@jamkazam.com. Were always happy to help!" paragraph2: "For next steps after your profile, dont forget you can always refer back to the Welcome email we sent you when you signed up. And if you run into any problems or get stuck, please send us email at support@jamkazam.com. Were always happy to help!"
regards: "Best Regards," regards: "Best Regards,"
signature: "JamKazam Team" signature: "JamKazam Team"
profile_complete_reminder3: profile_complete_reminder3:
subject: "Complete your JamKazam profile" subject: "Complete your JamKazam profile"
greeting: "Hello" greeting: "Hello"
@ -100,7 +98,6 @@ en:
update_profile: "Update Profile" update_profile: "Update Profile"
regards: "Best Regards," regards: "Best Regards,"
signature: "JamKazam Team" signature: "JamKazam Team"
gear_setup_reminder1: gear_setup_reminder1:
subject: "Set up audio gear in JamKazam now so you can get in your first session" subject: "Set up audio gear in JamKazam now so you can get in your first session"
greeting: "Hello" greeting: "Hello"
@ -113,7 +110,6 @@ en:
If you have any trouble or feel confused about gear setup, you can email us for help at <a href="mailto:support@jamkazam.com">support@jamkazam.com</a>. You can also visit with a JamKazam support team member in our <a href="https://us02web.zoom.us/j/5967470315?pwd=eHZZL2hmVW1haUU5aTZTUUJobjFIdz09">weekly Zoom office hours</a>, which is offered every Wednesday from 11am to 12pm US Central Time. If you have any trouble or feel confused about gear setup, you can email us for help at <a href="mailto:support@jamkazam.com">support@jamkazam.com</a>. You can also visit with a JamKazam support team member in our <a href="https://us02web.zoom.us/j/5967470315?pwd=eHZZL2hmVW1haUU5aTZTUUJobjFIdz09">weekly Zoom office hours</a>, which is offered every Wednesday from 11am to 12pm US Central Time.
regards: "Best Regards," regards: "Best Regards,"
signature: "JamKazam Team" signature: "JamKazam Team"
gear_setup_reminder2: gear_setup_reminder2:
subject: "Set up your gear in JamKazam now to connect with other musicians" subject: "Set up your gear in JamKazam now to connect with other musicians"
greeting: "Hello" greeting: "Hello"
@ -127,7 +123,6 @@ en:
If you have any trouble or feel confused about gear setup, you can email us for help at <a href="mailto:support@jamkazam.com">support@jamkazam.com</a>. You can also visit with a JamKazam support team member in our <a href="https://us02web.zoom.us/j/5967470315?pwd=eHZZL2hmVW1haUU5aTZTUUJobjFIdz09">weekly Zoom office hours</a>, which is offered every Wednesday from 11am to 12pm US Central Time. If you have any trouble or feel confused about gear setup, you can email us for help at <a href="mailto:support@jamkazam.com">support@jamkazam.com</a>. You can also visit with a JamKazam support team member in our <a href="https://us02web.zoom.us/j/5967470315?pwd=eHZZL2hmVW1haUU5aTZTUUJobjFIdz09">weekly Zoom office hours</a>, which is offered every Wednesday from 11am to 12pm US Central Time.
regards: "Best Regards," regards: "Best Regards,"
signature: "JamKazam Team" signature: "JamKazam Team"
gear_setup_reminder3: gear_setup_reminder3:
subject: Dont waste your free 30-day premium gold plan - set up your gear now! subject: Dont waste your free 30-day premium gold plan - set up your gear now!
greeting: "Hello" greeting: "Hello"
@ -143,6 +138,64 @@ en:
If you have any trouble or feel confused about gear setup, you can email us for help at <a href="mailto:support@jamkazam.com">support@jamkazam.com</a>. You can also visit with a JamKazam support team member in our <a href="https://us02web.zoom.us/j/5967470315?pwd=eHZZL2hmVW1haUU5aTZTUUJobjFIdz09">weekly Zoom office hours</a>, which is offered every Wednesday from 11am to 12pm US Central Time. If you have any trouble or feel confused about gear setup, you can email us for help at <a href="mailto:support@jamkazam.com">support@jamkazam.com</a>. You can also visit with a JamKazam support team member in our <a href="https://us02web.zoom.us/j/5967470315?pwd=eHZZL2hmVW1haUU5aTZTUUJobjFIdz09">weekly Zoom office hours</a>, which is offered every Wednesday from 11am to 12pm US Central Time.
regards: "Best Regards," regards: "Best Regards,"
signature: "JamKazam Team" signature: "JamKazam Team"
test_gear_reminder1:
subject: "Test your gear in a private JamKazam session to get ready to go!"
greeting: "Hello"
paragraph1: |
Now that you have set up your gear, we recommend that you get into a private session alone to test that your gear is working properly and to get familiar with some of the key features youll want to use when in a session with other musicians.
paragraph2: |
To get into a private session on your own, we recommend you connect your computer to your home router using an Ethernet cable (just to get into the practice of doing this), and then follow the instructions <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000122469">in this help article</a> to quick start a private session.
paragraph3: |
Once youre in the session, we recommend you explore the following features:
<ul>
<li>
Use the instructions <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000505535">in this help article</a> to set the input levels for your instrument(s) and/or voice to a healthy spot. This is an important step to get good audio, both for you and for others in your sessions.
</li>
<li>
Use the instructions <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000124834">in this help article</a> to adjust your personal session mix. Since youre alone in a test session right now, you wont be able to adjust the volume of other musicians on your session, but youll learn how to do it when youre in a session with others. This feature is critical, as it lets each musician in a session dial in a mix that sounds good to them, without affecting what other musicians hear
</li>
<li>
If you plan to use video in sessions, in addition to audio, use the instructions <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000124837">in this help article</a> to test that your webcam is working well with the JamKazam app.
</li>
<li>
You can also review help articles on how to <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000124835">use backing tracks</a> in sessions, <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000124836">use a metronome</a> in sessions, and <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000124840">use our diagnostics</a> to troubleshoot problems in sessions.
</li>
<li>
When youre doing exploring, learning, and getting comfortable, you can <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000124841">leave your private test session</a>.
</li>
</ul>
paragraph4: |
If you still feel like you want to get more comfortable in online sessions before starting to jump in with others, we offer a weekly office hours JamKazam session every Tuesday 7-8pm US Central Time. You can join this session as a safe space with a JamKazam support team member to experience and learn how to play in online sessions, or to ask questions about particular features or issues youre having. To find this session, start the JamKazam app, click the Find Session tile, then click the Open Jams tile, and look for the session called “JamKazam Office Hours”, and click the Join icon on this session.
paragraph5: |
If you have any trouble or feel confused while testing things out, you can email us for help at <a href="mailto:support@jamkazam.com">support@jamkazam.com</a>. You can also visit with a JamKazam support team member in our <a href="https://us02web.zoom.us/j/5967470315?pwd=eHZZL2hmVW1haUU5aTZTUUJobjFIdz09">weekly Zoom office hours</a>, which is offered every Wednesday from 11am to 12pm US Central Time.
regards: "Best Regards,"
signature: "JamKazam Team"
test_gear_reminder2:
subject: "Test your gear and learn how to use key features in a private JamKazam"
greeting: "Hello"
paragraph1: "Before hopping into JamKazam sessions with other musicians, we recommend you get into a private session alone to test that your gear is working properly and to get familiar with some of the key features youll want to use when in a session with other musicians."
paragraph2: |
To get into a private session on your own, start up the JamKazam app, click the big orange Create Session tile, and then click the Quick Start Private button. This will drop you into a private session alone. Once youre in the session, we recommend you read/review the help topics <a href="https://jamkazam.freshdesk.com/support/solutions/folders/66000110433">on this help page</a> to familiarize yourself with the features explained in these help articles, as youll use most of these features.
paragraph3: |
After doing this, if you still feel like you want to get more comfortable in online sessions before starting to jump in with others, we offer a weekly office hours JamKazam session every Tuesday 7-8pm US Central Time. You can join this session as a safe space with a JamKazam support team member to experience and learn how to play in online sessions, or to ask questions about particular features or issues youre having. To find this session, start the JamKazam app, click the Find Session tile, then click the Open Jams tile, and look for the session called “JamKazam Office Hours”, and click the Join icon on this session.
paragraph4: |
If you have any trouble or feel confused while testing things out, you can email us for help at <a href="mailto:support@jamkazam.com">support@jamkazam.com</a>. You can also visit with a JamKazam support team member in our <a href="https://us02web.zoom.us/j/5967470315?pwd=eHZZL2hmVW1haUU5aTZTUUJobjFIdz09">weekly Zoom office hours</a>, which is offered every Wednesday from 11am to 12pm US Central Time.
regards: "Best Regards,"
signature: "JamKazam Team"
test_gear_reminder3:
subject: "Dont waste your free 30-day premium gold plan get in a test session now!"
greeting: "Hello"
paragraph1: "When you sign up for JamKazam, we give you a free 30-day premium gold plan so you can fully experience how amazing our online sessions are and how JamKazam can help you play more music with more people to bring more musical joy to your life."
paragraph2: |
Dont waste your 30-day window! Test your gear in a private JamKazam session now, so that youre ready to join sessions and play with other musicians.
paragraph3: |
To get into a private session on your own, start up the JamKazam app, click the big orange Create Session tile, and then click the Quick Start Private button. This will drop you into a private session alone. Once youre in the session, we recommend you read/review the help topics <a href="https://jamkazam.freshdesk.com/support/solutions/folders/66000110433">on this help page</a> to familiarize yourself with the features explained in these help articles, as youll use most of these features.
paragraph4: |
After doing this, if you still feel like you want to get more comfortable in online sessions before starting to jump in with others, we offer a weekly office hours JamKazam session every Tuesday 7-8pm US Central Time. You can join this session as a safe space with a JamKazam support team member to experience and learn how to play in online sessions, or to ask questions about particular features or issues youre having. To find this session, start the JamKazam app, click the Find Session tile, then click the Open Jams tile, and look for the session called “JamKazam Office Hours”, and click the Join icon on this session.
paragraph5: |
If you have any trouble or feel confused while testing things out, you can email us for help at <a href="mailto:support@jamkazam.com">support@jamkazam.com</a>. You can also visit with a JamKazam support team member in our <a href="https://us02web.zoom.us/j/5967470315?pwd=eHZZL2hmVW1haUU5aTZTUUJobjFIdz09">weekly Zoom office hours</a>, which is offered every Wednesday from 11am to 12pm US Central Time.
regards: "Best Regards,"
signature: "JamKazam Team"
signup_survey: signup_survey:
subject: "Let us help you to be successful on JamKazam" subject: "Let us help you to be successful on JamKazam"
greeting: "Hi" greeting: "Hi"