Skip to content

Commit

Permalink
Pass section to leave zusatzsektion wizard and add bcc
Browse files Browse the repository at this point in the history
  • Loading branch information
njaeggi committed Dec 12, 2024
1 parent 009b710 commit fff64e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
9 changes: 5 additions & 4 deletions app/mailers/memberships/leave_zusatzsektion_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
class Memberships::LeaveZusatzsektionMailer < ApplicationMailer
CONFIRMATION = "memberships_leave_zusatzsektion_confirmation"

def confirmation(person, sektion_name, terminate_on)
def confirmation(person, section, terminate_on)
@person = person
@sektion_name = sektion_name
@section = section
@terminate_on = terminate_on
headers[:cc] = Group::Geschaeftsstelle.first.email
headers[:bcc] = [section.email, SacCas::MV_EMAIL].compact_blank

compose(person, CONFIRMATION)
end
Expand All @@ -23,8 +24,8 @@ def placeholder_person_name
@person.to_s
end

def placeholder_sektion_name
@sektion_name
def placeholder_group_name
@section.display_name
end

def placeholder_terminate_on
Expand Down
6 changes: 1 addition & 5 deletions app/models/wizards/memberships/leave_zusatzsektion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class LeaveZusatzsektion < Wizards::Base

attr_reader :person, :role

def sektion_name
role.layer_group.display_name
end

def initialize(person:, role:, current_step: 0, backoffice: false, **params)
@person = person
@role = role
Expand Down Expand Up @@ -70,7 +66,7 @@ def family_membership?
def send_confirmation_mail
Memberships::LeaveZusatzsektionMailer.confirmation(
person,
sektion_name,
role.layer_group,
I18n.l(terminate_on)
).deliver_later
end
Expand Down
4 changes: 2 additions & 2 deletions db/seeds/custom_contents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
placeholders_required: "first-name",
placeholders_optional: "profile-url"},
{key: Memberships::LeaveZusatzsektionMailer::CONFIRMATION,
placeholders_required: "person-name, sektion-name, terminate-on"},
placeholders_required: "person-name, group-name, terminate-on"},
{key: Memberships::TerminateSacMembershipMailer::CONFIRMATION,
placeholders_required: "person-name, sektion-name, terminate-on"},
{key: Memberships::SwitchStammsektionMailer::CONFIRMATION,
Expand Down Expand Up @@ -404,7 +404,7 @@
label: "Mitgliedschaften: Bestätigung Austritt Zusatzsektion",
subject: "Bestätigung Austritt Zusatzsektion",
body: "Hallo {person-name},<br><br>" \
"Der Austritt aus {sektion-name} wurde per {terminate-on} vorgenommen."},
"Der Austritt aus {group-name} wurde per {terminate-on} vorgenommen."},
{custom_content_id: CustomContent.get(Memberships::TerminateSacMembershipMailer::CONFIRMATION).id,
locale: "de",
label: "Bestätigung SAC Austritt",
Expand Down

0 comments on commit fff64e9

Please sign in to comment.