Skip to content

Commit

Permalink
Use root group instead of event group for bcc (#1552)
Browse files Browse the repository at this point in the history
  • Loading branch information
njaeggi authored and TheWalkingLeek committed Feb 11, 2025
1 parent 95a27e8 commit 54823cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/mailers/event/participation_canceled_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def confirmation(participation)
@participation = participation
@course = participation.event
@person = participation.person
headers[:bcc] = @course.groups.first.course_admin_email
headers[:bcc] = Group.root.course_admin_email
locales = @course.language.split("_")

compose_multilingual(@person, CONFIRMATION, locales)
Expand Down
6 changes: 4 additions & 2 deletions spec/mailers/event/participation_canceled_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
require "spec_helper"

describe Event::ParticipationCanceledMailer do
let(:event) { Fabricate(:sac_open_course) }
let(:event) { Fabricate(:sac_open_course, groups: [groups(:bluemlisalp)]) }
let(:participation) { event.participations.create!(person: people(:mitglied)) }
let(:mail) { described_class.confirmation(participation) }

before { event.groups.first.update!(course_admin_email: "admin@example.com") }
before do
Group.root.update!(course_admin_email: "admin@example.com")
end

it "sends to email addresses of participant" do
expect(mail.to).to match_array(["e.hillary@hitobito.example.com"])
Expand Down

0 comments on commit 54823cc

Please sign in to comment.