Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ class ApplicationMailer < ActionMailer::Base

OPERATIONS_EMAIL = "hcb@hackclub.com"

ENGINEERING_EMAIL = "hcb-engr@hackclub.com"

DOMAIN = Rails.env.production? ? "hackclub.com" : "staging.hcb.hackclub.com"
default from: "HCB <hcb@#{DOMAIN}>"
layout "mailer/default"
Expand Down
3 changes: 2 additions & 1 deletion config/blazer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ user_method: blazer_current_user
# before_action_method: require_admin

# email to send checks from
from_email: hcb@hackclub.com
# Bounces and auto-replies land back here, so keep it off Intercom.
from_email: hcb-engr@hackclub.com

# webhook for Slack
# slack_webhook_url: <%= ENV["BLAZER_SLACK_WEBHOOK_URL"] %>
Expand Down
9 changes: 9 additions & 0 deletions config/initializers/blazer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

Rails.application.config.to_prepare do
Blazer::Check.class_eval do
after_initialize do
self.emails = ApplicationMailer::ENGINEERING_EMAIL if new_record? && emails.blank?
end
end
end
23 changes: 23 additions & 0 deletions db/migrate/20260808175000_point_blazer_checks_at_engineering.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

# Existing checks still notify hcb@, which lands in Intercom.
# Migrate all checks that use operations email to use engr email.

class PointBlazerChecksAtEngineering < ActiveRecord::Migration[8.1]
OPERATIONS_EMAIL = "hcb@hackclub.com"
ENGINEERING_EMAIL = "hcb-engr@hackclub.com"

def up
Blazer::Check.where("emails ILIKE ?", "%#{OPERATIONS_EMAIL}%").find_each do |check|
recipients = check.emails.to_s.split(",").map { |email| email.strip.downcase }
rewritten = recipients.map { |email| email == OPERATIONS_EMAIL ? ENGINEERING_EMAIL : email }.uniq
next if rewritten == recipients

check.update_columns(emails: rewritten.join(", "))
end
end

def down
end

end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[8.1].define(version: 2026_08_05_120000) do
ActiveRecord::Schema[8.1].define(version: 2026_08_08_175000) do
# These are extensions that must be enabled in order to support this database
enable_extension "citext"
enable_extension "pg_catalog.plpgsql"
Expand Down
Loading