From 48472fbd484769fe3e1419654b5bdb1e7e03dd36 Mon Sep 17 00:00:00 2001 From: Eobam Date: Tue, 9 Dec 2025 21:56:06 -0500 Subject: [PATCH 1/2] stuff --- .../slack/interactivity_controller.rb | 1 + app/jobs/slack/backyard_garden.rb | 3 ++ app/mailers/backyardgarden_mailer.rb | 42 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 app/jobs/slack/backyard_garden.rb create mode 100644 app/mailers/backyardgarden_mailer.rb diff --git a/app/controllers/slack/interactivity_controller.rb b/app/controllers/slack/interactivity_controller.rb index e266ce6..fbdef14 100644 --- a/app/controllers/slack/interactivity_controller.rb +++ b/app/controllers/slack/interactivity_controller.rb @@ -32,6 +32,7 @@ def handle_block_actions(payload) head :ok end + def set_current_identity payload = JSON.parse(params[:payload]) diff --git a/app/jobs/slack/backyard_garden.rb b/app/jobs/slack/backyard_garden.rb new file mode 100644 index 0000000..ea51852 --- /dev/null +++ b/app/jobs/slack/backyard_garden.rb @@ -0,0 +1,3 @@ +class Slack::BackyardgardenJoinFlow < ApplicationJob + +end \ No newline at end of file diff --git a/app/mailers/backyardgarden_mailer.rb b/app/mailers/backyardgarden_mailer.rb new file mode 100644 index 0000000..bcff6bb --- /dev/null +++ b/app/mailers/backyardgarden_mailer.rb @@ -0,0 +1,42 @@ +class BackyardGarden_Mailer < ApplicationMailer + def first_email(identity) + @identity = identity + @first_name = @identity.first_name + + mail( + to: @identity.primary_email,, + subject: Hack Club Onboarding + ) + end + + def ysws_email(identity) + @identity = identity + @first_name = @identity.first_name + + mail( + to: @identity.primary_email,, + subject: YSWS Onboarding + ) + end + + def community_events(identity) + @identity = identity + @first_name = @identity.first_name + + mail( + to: @identity.primary_email,, + subject: Community Events Onboarding + ) + end + + def clubs_email(identity) + @identity = identity + @first_name = @identity.first_name + + mail( + to: @identity.primary_email,, + subject: Putting the Club in Hack Club + ) + end + +end \ No newline at end of file From 4f2e0c926dbdc470a4819b23a2e7a7aa8a4c0bad Mon Sep 17 00:00:00 2001 From: Eobam Date: Tue, 9 Dec 2025 22:16:26 -0500 Subject: [PATCH 2/2] Add BackyardGarden flow --- app/controllers/logins_controller.rb | 2 ++ app/jobs/slack/backyard_garden.rb | 4 ++++ app/mailers/backyardgarden_mailer.rb | 16 ++++++++-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/controllers/logins_controller.rb b/app/controllers/logins_controller.rb index 7dcc0cf..b171ae6 100644 --- a/app/controllers/logins_controller.rb +++ b/app/controllers/logins_controller.rb @@ -290,6 +290,8 @@ def provision_slack_on_first_login(scenario) if Flipper.enabled?(:are_we_enterprise_yet, current_identity) && scenario.slack_onboarding_flow == :internal_tutorial Tutorial::BeginJob.perform_later(@identity) end + + Slack::BackyardgardenFlow.perform_later(@identity) slack_result else diff --git a/app/jobs/slack/backyard_garden.rb b/app/jobs/slack/backyard_garden.rb index ea51852..7ff27d8 100644 --- a/app/jobs/slack/backyard_garden.rb +++ b/app/jobs/slack/backyard_garden.rb @@ -1,3 +1,7 @@ class Slack::BackyardgardenJoinFlow < ApplicationJob + queue_as :default + def first_email_send(identity) + BackyardGarden_Mailer.first_email(identity).deliver_now + end end \ No newline at end of file diff --git a/app/mailers/backyardgarden_mailer.rb b/app/mailers/backyardgarden_mailer.rb index bcff6bb..0bc25ac 100644 --- a/app/mailers/backyardgarden_mailer.rb +++ b/app/mailers/backyardgarden_mailer.rb @@ -4,8 +4,8 @@ def first_email(identity) @first_name = @identity.first_name mail( - to: @identity.primary_email,, - subject: Hack Club Onboarding + to: @identity.primary_email, + subject: "Hack Club Onboarding" ) end @@ -14,8 +14,8 @@ def ysws_email(identity) @first_name = @identity.first_name mail( - to: @identity.primary_email,, - subject: YSWS Onboarding + to: @identity.primary_email, + subject: "YSWS Onboarding" ) end @@ -24,8 +24,8 @@ def community_events(identity) @first_name = @identity.first_name mail( - to: @identity.primary_email,, - subject: Community Events Onboarding + to: @identity.primary_email, + subject: "Community Events Onboarding" ) end @@ -34,8 +34,8 @@ def clubs_email(identity) @first_name = @identity.first_name mail( - to: @identity.primary_email,, - subject: Putting the Club in Hack Club + to: @identity.primary_email, + subject: "Putting the Club in Hack Club" ) end