Skip to content

HOLD: Add admin-only option to skip the payer confirmation email (bulk payments)#1627

Open
maebeale wants to merge 3 commits into
mainfrom
maebeale/bulk-payment-emails
Open

HOLD: Add admin-only option to skip the payer confirmation email (bulk payments)#1627
maebeale wants to merge 3 commits into
mainfrom
maebeale/bulk-payment-emails

Conversation

@maebeale

@maebeale maebeale commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Closes [link an issue or remove this line]

Stacked on #1647 (bulk payment confirmation + FYI emails). Review/merge that first; this PR's diff is only the admin skip-email layer. Once #1647 merges, this PR will be retargeted to main.

What is the goal of this PR and why is this important?

  • Staff frequently submit bulk payments on someone's behalf, where the automatic confirmation email to the payer is unwanted noise (and sometimes reaches someone who never asked to be emailed).
  • This adds an admin-only option to suppress the payer confirmation for those submissions, while still sending the staff FYI.

How did you approach the change?

  • BulkPayment gained a send_confirmation: flag; the controller only honors on_behalf for users who can manage the event (so a guest can't suppress their own confirmation) and finds/creates the payer from the form rather than the admin.
  • An admin-only checkbox on the bulk payment form toggles this, and a small on-behalf Stimulus controller reveals the payer identity fields that are normally hidden for a logged-in admin. Added a "Bulk payment on behalf" entry to the event Form actions menu.

UI Testing Checklist

  • As an admin, open a bulk payment form — the blue "Submitting on someone's behalf / Admin only" toggle appears (hidden from logged-out visitors).
  • Checking the toggle reveals the payer name/email fields; unchecking re-hides them.
  • Submitting on-behalf sends no payer confirmation (staff FYI still arrives); a normal submission emails both.
  • "Bulk payment on behalf" entry in the Form actions menu pre-checks the toggle.

Anything else to add?

@maebeale maebeale marked this pull request as ready for review June 11, 2026 14:19
@@ -48,9 +48,8 @@ def create
notice: "Your bulk payment information has been submitted."
end

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: on_behalf? is gated by allowed_to?(:dashboard?, @event) so a logged-out visitor can never set on_behalf=1 to suppress the payer confirmation — the param alone is not enough.

if @send_confirmation
payer_email = person.preferred_email.presence || field_value("payer_email")&.strip
if payer_email.present?
NotificationServices::CreateNotification.call(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: Only the payer confirmation is gated by @send_confirmation; the staff FYI always sends. This matches PR #1626 — on-behalf submissions still notify staff, they just do not email the payer.

# matches the submission's own role (e.g. a "bulk_payment" submission maps to
# the event_form with role "bulk_payment").
def event
form.events.find_by(event_forms: { role: role })

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: Resolves the event by matching the submission role against the event_forms join role (e.g. bulk_payment), since FormSubmission has no direct event association. The mailers rely on this to render the event block.

@maebeale maebeale requested a review from jmilljr24 June 11, 2026 14:20
@maebeale maebeale force-pushed the maebeale/bulk-payment-emails branch 3 times, most recently from 4886068 to 34897d5 Compare June 13, 2026 14:56
maebeale and others added 2 commits June 13, 2026 11:12
bundler-audit (CI scan_ruby) flags net-imap 0.6.4 for CVE-2026-47240,
47241, and 47242. Conservative bump to the patched 0.6.4.1; transitive
dependency, no Gemfile change needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bulk payment submissions previously sent no email at all, unlike event
registrations, so a submission could land in the database silently. Payers
now receive a confirmation and staff receive an FYI for every submission,
reusing the existing notification pipeline.

Also fixes a stale answer_type (multiple_choice_radio -> single_select_radio)
in the bulk payments request spec left behind by the enum cleanup in #1644.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Staff frequently submit bulk payments on someone's behalf, where the
automatic confirmation to the payer is unwanted noise. Adds an admin-only
"on behalf" toggle that suppresses the payer confirmation while still
sending the staff FYI, and reveals the otherwise-hidden payer identity
fields so the submission is attributed to the payer, not the admin.

Stacked on the confirmation/FYI email branch (#1647).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maebeale maebeale changed the base branch from main to maebeale/bulk-payment-confirmation-emails June 13, 2026 15:13
@maebeale maebeale force-pushed the maebeale/bulk-payment-emails branch from 94b6a50 to aaa790d Compare June 13, 2026 15:13
@maebeale maebeale changed the title Send confirmation + FYI emails for bulk payments, with admin skip option Add admin-only option to skip the payer confirmation email (bulk payments) Jun 13, 2026
@maebeale maebeale force-pushed the maebeale/bulk-payment-confirmation-emails branch from b36aa95 to 7c411f1 Compare June 13, 2026 17:54
Base automatically changed from maebeale/bulk-payment-confirmation-emails to main June 13, 2026 18:04
@maebeale maebeale changed the title Add admin-only option to skip the payer confirmation email (bulk payments) HOLD: Add admin-only option to skip the payer confirmation email (bulk payments) Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant