Skip to content
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

Fix/issue 36360 #37883

Merged
merged 6 commits into from May 3, 2023
Merged

Fix/issue 36360 #37883

merged 6 commits into from May 3, 2023

Conversation

shadimanna
Copy link
Contributor

Submission Review Guidelines:

Changes proposed in this Pull Request:

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

Closes #36360 .

How to test the changes in this Pull Request:

  1. Go to WooCommerce > Settings > Email
  2. Select the "New order" email
  3. Remove the text within the "Additional content" field
  4. Make an order on the shop
  5. Verify the Admin New Order email does not contain the default text "Congratulations on the sale."

@github-actions github-actions bot added plugin: woocommerce Issues related to the WooCommerce Core plugin. type: community contribution labels Apr 20, 2023
@woocommercebot woocommercebot requested review from a team and barryhughes and removed request for a team April 20, 2023 13:24
* @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 ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking that rather than suppress the linter warning, which makes it a little harder to surface missing docblocks in the future (because PHPCS will stop complaining about any with this phpcs:ignore comment), probably the best course of action would be to document the original hook in WC_Email and then mark this one as a duplicate hook.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@barryhughes I was discussing this with @jorgeatorres and he mentioned using the phpcs:ignore comment because it was a duplicate. Maybe he can jump in to this conversation and give his opinion.

barryhughes
barryhughes previously approved these changes Apr 21, 2023
Copy link
Member

@barryhughes barryhughes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a suggestion, otherwise this works well—thank you! Once we're happy with inline documentation for the hook we can go ahead and merge 👍

@shadimanna
Copy link
Contributor Author

Left a suggestion, otherwise this works well—thank you! Once we're happy with inline documentation for the hook we can go ahead and merge 👍

Did you see my comment on the PHPCS @barryhughes ?

@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2023

Hi ,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@barryhughes
Copy link
Member

Did you see my comment on the PHPCS @barryhughes ?

Yes, thank you. We just discussed this and I pushed a small change—we'll aim to re-review shortly!

Copy link
Member

@jorgeatorres jorgeatorres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍.

Tested that the "Congratulations on your sale" message no longer appears when removed from the e-mail via Settings. Also, when the woocommerce_new_order_settings option doesn't exist, the default e-mail message gets used (which does include the additional content).


Thank you @shadimanna for your contribution and @barryhughes for the first round of review.

@jorgeatorres jorgeatorres merged commit 9bbe72d into woocommerce:trunk May 3, 2023
17 of 18 checks passed
@github-actions github-actions bot added this to the 7.8.0 milestone May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin. type: community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Give option to remove Congratulations on Sale for New Orders in the Emails
3 participants