Remove the default text in "Additional content" being sent for all emails when the field is empty for Admin New Order email

This commit is contained in:
Shadi Manna 2023-04-20 15:13:28 +02:00
parent 230ff742bf
commit 7ae2e66e58
3 changed files with 14 additions and 2 deletions

View File

@ -1,4 +1,4 @@
Significance: patch
Type: fix
Remove the default text in "Additional content" being sent for all emails when the field is empty
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,18 @@ 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() {
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,7 +400,7 @@ class WC_Email extends WC_Settings_API {
* @return string
*/
public function get_additional_content() {
return apply_filters( 'woocommerce_email_additional_content_' . $this->id, $this->format_string( $this->get_option( 'additional_content' ) ), $this->object, $this );
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 );
}
/**