Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Add hook to conditionally not send email

$
0
0

Replies: 0

For a while, I had simply been disabling this plugin on my staging sites because I didn’t want WC order emails getting sent out while I was testing

That creates an issue because if I want some user testing done, the user may want to perform a password reset or see some other kind of confirmation email.

I propose adding an action hook to allow some outside code to conditionally do a wp_die() to prevent email sending.

Something like this could go just before all the include_once statements (line ~627)
do_action('gmail_smtp_before_send',compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );

  • This topic was modified 15 minutes ago by bheadrick.

Viewing all articles
Browse latest Browse all 59525

Trending Articles