Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send email to site admins when reward is claimed #923

Merged
merged 5 commits into from
Apr 24, 2024

Conversation

clatwell
Copy link
Contributor

The PR essentially duplicates the the Reward Claimed email to the Auction Winner to send to the Site Admins.

I know the trigger_on_reward_claimed isn't right since I just copied it over from the Auction Reward Claimed email. I could use some help updating that so it sends to all the site admins, like we have here.

Let me know what else I missed!

Comment on lines 52 to 62
private function trigger_on_reward_claimed(): void {
add_action(
'goodbids_reward_redeemed',
function ( int $auction_id, int $order_id ) {
$order = wc_get_order( $order_id );
$this->trigger( $order, get_current_user_id() );
},
10,
2
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied this over from the AuctionRewardClaimed email. I could use some help updating it so it triggers to send to site admins instead of the current user.

@clatwell clatwell requested a review from bd-viget April 24, 2024 14:25
Copy link
Contributor

@bd-viget bd-viget left a comment

Choose a reason for hiding this comment

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

SUPER CLOSE! Nice job!! 💯 You probably would have figured this out 100% if you compared to one of the Admin emails like AuctionIsLiveAdmin. Gonna approve it so I'm not a blocker.

clatwell and others added 2 commits April 24, 2024 12:02
…ils/AuctionRewardClaimedAdmin.php

Co-authored-by: Brian DiChiara <[email protected]>
…ils/AuctionRewardClaimedAdmin.php

Co-authored-by: Brian DiChiara <[email protected]>
@clatwell clatwell merged commit 38b8f8f into main Apr 24, 2024
1 check passed
@clatwell clatwell deleted the cae-reward-claimed-admin branch April 24, 2024 16:09
@clatwell
Copy link
Contributor Author

Hey @bd-viget, I must not have been as close as we thought because I tested this on Staging and the Auction Reward Claimed Admin email didn't fire :(

https://staging.goodbids.org/seagull/wp-admin/admin.php?page=wp-mail-smtp-logs

I can see the in WP Mail SMTP logs that the Reward Claim Confirmation for the winner did send, but the corresponding admin email isn't showing up:

Screenshot 2024-04-24 at 2 07 23 PM

If you have a few minutes, do you mind investigating to see what else I missed in this PR? Thanks, and sorry for the hassle.

Copy link
Contributor

Choose a reason for hiding this comment

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

@clatwell Yep! This is it! You need to add the class to the array around line 106.

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.

2 participants