Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 27, 2025

Summary of the problem

Card grant senders receive "New virtual HCB card" emails when recipients activate their grants. This is unintended—the email is meant for users creating their own cards, not for card grant activations.

image

Describe your changes

StripeCard has an existing skip_notify_user attr_accessor that suppresses the after_create_commit :notify_user callback, but StripeCardService::Create wasn't using it.

  • Added skip_notify_user parameter to StripeCardService::Create (defaults to false)
  • Set skip_notify_user on the card instance before saving
  • Pass skip_notify_user: true from CardGrant#create_stripe_card
# CardGrant#create_stripe_card
self.stripe_card = StripeCardService::Create.new(
  card_type: "virtual",
  event_id:,
  current_user: user,
  ip_address:,
  subledger:,
  skip_notify_user: true,  # Suppress email for card grant activations
).run
Original prompt

This section details on the original issue you should resolve

<issue_title>[CardGrant] Disable "New virtual card" email when activating card grant</issue_title>
<issue_description>Card grant senders are now getting these emails whenever someone activates their card grant. It wasn't always like this

Image

More context: https://hackclub.slack.com/archives/GBXBFEED9/p1764186679145649</issue_description>

<agent_instructions>Investigate this. See if there's an obvious code change or cause. Then, if you've found one, try and fix it. Otherwise, mention me with your findings and I'll investigate further.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Disable email for activating card grant Disable "New virtual card" email when activating card grant Nov 27, 2025
Copilot AI requested a review from YodaLightsabr November 27, 2025 00:48
Copilot finished work on behalf of YodaLightsabr November 27, 2025 00:48
@sampoder
Copy link
Member

This fix doesn't make sense?

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.

[CardGrant] Disable "New virtual card" email when activating card grant

3 participants