hcb icon indicating copy to clipboard operation
hcb copied to clipboard

[Admin] ‘Follow’ a card/card grant

Open leowilkin opened this issue 7 months ago • 1 comments

Describe the problem

E.g. there’s a card grant that’s had some suspicious failed purchases, and the owner has been sent a warning email. As an admin, I want to keep tabs of this card, and any future purchases.

Or, it’s a colleague’s card, and you want to keep tabs of their spending.

Describe the feature/solution (optional)

Usually you’d have to go onto HCB, and either keep a tab open with the card grant, or check the ledger every so often. This is time consuming, and doesn’t give you immediate updates.

The way I had in mind would be to ‘subscribe/follow’ updates to that card. Admin only button that you can toggle, and when a card has any activity (failed transaction, transaction succeeded) etc, it sends you an email, similar to when you follow a GH issue.

”You’re receiving this email because you subscribed to card ••••1234

A new transaction ($113), at SHADYSITE.INC succeeded.”

leowilkin avatar May 26 '25 08:05 leowilkin

Not sure if we should do this but should be pretty easy as an extension to the activity log system.

You could an after create commit callback to PublicActivity::Activity that queues a job (important as little as possible in the callback) that checks if it's card grant related and if anyone is following the card grant. And if there are, it emails them. We should make a general Subscriber model or something to store this data.

sampoder avatar May 30 '25 01:05 sampoder