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/controllers/slack/interactivity_controller.rb b/app/controllers/slack/interactivity_controller.rb index 4ff4927..869e54f 100644 --- a/app/controllers/slack/interactivity_controller.rb +++ b/app/controllers/slack/interactivity_controller.rb @@ -34,6 +34,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..7ff27d8 --- /dev/null +++ b/app/jobs/slack/backyard_garden.rb @@ -0,0 +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 new file mode 100644 index 0000000..0bc25ac --- /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