Introduces a new hook after an email is sent

Closes #24641
This commit is contained in:
Claudio Sanches 2021-06-17 12:36:25 -03:00
parent 9f8d3e84dc
commit a19b2a34cf
1 changed files with 10 additions and 0 deletions

View File

@ -658,6 +658,16 @@ class WC_Email extends WC_Settings_API {
remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
$id = $this->id ? $this->id : 'default';
/**
* Action hook fired when an email is sent.
*
* @since 5.5.0
* @param bool $return Whether the email was sent successfully.
* @param WC_Email $this WC_Email instance.
*/
do_action( 'woocommerce_email_' . $id . '_sent', $return, $this );
return $return;
}