-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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 | ||
); | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
client-mu-plugins/goodbids/src/classes/Plugins/WooCommerce/Emails/AuctionRewardClaimedAdmin.php
Outdated
Show resolved
Hide resolved
client-mu-plugins/goodbids/src/classes/Plugins/WooCommerce/Emails/AuctionRewardClaimedAdmin.php
Outdated
Show resolved
Hide resolved
…ils/AuctionRewardClaimedAdmin.php Co-authored-by: Brian DiChiara <[email protected]>
…ils/AuctionRewardClaimedAdmin.php Co-authored-by: Brian DiChiara <[email protected]>
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: 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. |
There was a problem hiding this comment.
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.
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!