diff --git a/ruby/db/migrate/20250605092511_add_signup_survey_sent_at_to_users.rb b/ruby/db/migrate/20250605092511_add_signup_survey_sent_at_to_users.rb new file mode 100644 index 000000000..879bda4a2 --- /dev/null +++ b/ruby/db/migrate/20250605092511_add_signup_survey_sent_at_to_users.rb @@ -0,0 +1,8 @@ + class AddSignupSurveySentAtToUsers < ActiveRecord::Migration + def self.up + execute "ALTER TABLE users ADD COLUMN signup_survey_sent_at TIMESTAMP" + end + def self.down + execute "ALTER TABLE users DROP COLUMN signup_survey_sent_at" + end + end diff --git a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb index 9dec8cfe6..0dc56450a 100644 --- a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb +++ b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb @@ -480,6 +480,16 @@ module JamRuby end end + def signup_survey(user) + @user = user + @subject = I18n.t('user_mailer.signup_survey.subject') + @survey_url = "https://www.surveymonkey.com/r/WVBKLYL" + mail(:to => user.email, :subject => @subject) do |format| + format.text + format.html { render layout: "user_mailer_beta" } + end + end + #################################### NOTIFICATION EMAILS #################################### def friend_request(user, msg, friend_request_id) return if !user.subscribe_email diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/signup_survey.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/signup_survey.html.erb new file mode 100644 index 000000000..b3e216fa9 --- /dev/null +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/signup_survey.html.erb @@ -0,0 +1,18 @@ +

<%= I18n.t 'user_mailer.signup_survey.greeting' -%> <%= @user.first_name -%> -

+ +

+ <%= I18n.t 'user_mailer.signup_survey.paragraph1' -%> +

+ +

+ <%= @survey_url %> +

+

+ <%= I18n.t 'user_mailer.signup_survey.ps' -%> + <%= I18n.t 'user_mailer.signup_survey.ps_text' -%> +

+ + +

<%= I18n.t 'user_mailer.signup_survey.regards' -%>
+ <%= I18n.t 'user_mailer.signup_survey.signature' -%> +

\ No newline at end of file diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/signup_survey.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/signup_survey.text.erb new file mode 100644 index 000000000..4834ebde6 --- /dev/null +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/signup_survey.text.erb @@ -0,0 +1,11 @@ +<%= I18n.t 'user_mailer.signup_survey.greeting' -%> <%= @user.first_name -%> - + +<%= I18n.t 'user_mailer.signup_survey.paragraph1' -%> + +<%= @survey_url %> + +<%= I18n.t 'user_mailer.signup_survey.ps' -%> +<%= I18n.t 'user_mailer.signup_survey.ps_text' -%> + +<%= I18n.t 'user_mailer.signup_survey.regards' -%>, +<%= I18n.t 'user_mailer.signup_survey.signature' -%> diff --git a/ruby/lib/jam_ruby/lib/email_signup_survey.rb b/ruby/lib/jam_ruby/lib/email_signup_survey.rb new file mode 100644 index 000000000..d03f7f3db --- /dev/null +++ b/ruby/lib/jam_ruby/lib/email_signup_survey.rb @@ -0,0 +1,15 @@ +module JamRuby + class EmailSignupSurvey + def self.send_survey + # if signup survey email has not been sent to this user, then send it + survey_users.each do |user| + UserMailer.signup_survey(user).deliver_now + user.update(signup_survey_sent_at: Time.now) + end + end + + def self.survey_users + User.where("users.signup_survey_sent_at IS NULL AND users.created_at < ?", 1.days.ago) + end + end +end \ No newline at end of file diff --git a/ruby/lib/jam_ruby/resque/scheduled/hourly_job.rb b/ruby/lib/jam_ruby/resque/scheduled/hourly_job.rb index a73b813b9..420909a28 100644 --- a/ruby/lib/jam_ruby/resque/scheduled/hourly_job.rb +++ b/ruby/lib/jam_ruby/resque/scheduled/hourly_job.rb @@ -14,6 +14,7 @@ module JamRuby User.hourly_check AffiliatePartner.tally_up(Date.today) EmailProfileReminder.send_reminders + EmailSignupSurvey.send_survey ConnectionManager.new.cleanup_dangling @@log.info("done") diff --git a/web/config/locales/en.yml b/web/config/locales/en.yml index 5f841d9b4..82453cdb5 100644 --- a/web/config/locales/en.yml +++ b/web/config/locales/en.yml @@ -142,4 +142,12 @@ en: paragraph5: | If you have any trouble or feel confused about gear setup, you can email us for help at support@jamkazam.com. You can also visit with a JamKazam support team member in our weekly Zoom office hours, which is offered every Wednesday from 11am to 12pm US Central Time. regards: "Best Regards," + signature: "JamKazam Team" + signup_survey: + subject: "Let us help you to be successful on JamKazam" + greeting: "Hi" + paragraph1: "Thanks for signing up to join our community of musicians! Please click the link below and take 2 minutes to let us know a little more about your goals. Our support team will use this information to provide tailored, individual help to you to make it faster and easier for you to be successful." + ps: "p.s." + ps_text: "If we can help in any way, please always feel free to contact us at" + regards: "Best Regards," signature: "JamKazam Team" \ No newline at end of file