Fix/issue 36360 (#37883)

This commit is contained in:
Jorge A. Torres 2023-05-03 18:23:45 -03:00 committed by GitHub
commit 9bbe72d431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Remove the default text in "Additional content" being sent for all emails when the field is empty for Admin New Order email

View File

@ -165,6 +165,23 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) :
return __( 'Congratulations on the sale.', 'woocommerce' );
}
/**
* Return content from the additional_content field.
*
* Displayed above the footer.
*
* @since 3.7.0
* @return string
*/
public function get_additional_content() {
/**
* This filter is documented in ./class-wc-email.php
*
* @since 7.8.0
*/
return apply_filters( 'woocommerce_email_additional_content_' . $this->id, $this->format_string( $this->get_option( 'additional_content' ) ), $this->object, $this );
}
/**
* Initialise settings form fields.
*/

View File

@ -400,6 +400,15 @@ class WC_Email extends WC_Settings_API {
* @return string
*/
public function get_additional_content() {
/**
* Provides an opportunity to inspect and modify additional content for the email.
*
* @since 3.7.0
*
* @param string $additional_content Additional content to be added to the email.
* @param object|bool $object The object (ie, product or order) this email relates to, if any.
* @param WC_Email $email WC_Email instance managing the email.
*/
return apply_filters( 'woocommerce_email_additional_content_' . $this->id, $this->format_string( $this->get_option( 'additional_content', $this->get_default_additional_content() ) ), $this->object, $this );
}