Skip to content
This repository was archived by the owner on Oct 4, 2019. It is now read-only.

Add a fix for keeping the site title and email footer in sync. #32

Merged
merged 1 commit into from
Jul 27, 2017

Conversation

emdashcodes
Copy link

@emdashcodes emdashcodes commented Jul 21, 2017

@ryelle @allendav This should help with Automattic/wp-calypso#16445.

This really makes me wish we had an additional plugin for things like this (since it is not something we want in core as-is), but as I mentioned on the call, I think this will be fine for now as long as we keep these things in hotfixes. And maybe add to the GitHub README in a separate PR.

I haven't bumped the version here since @ryelle already is. These can go in the same release.

To Test:

  • Apply this patch
  • Change your site title
  • Visit /store/order/{domain}/{orderID} and fulfill an order, giving it a tracking number (make anything up) and checking the "send to customer" box.
  • Make sure the subject and footer have your new site title, without having to go to wp-admin to update anything

@westi
Copy link

westi commented Jul 25, 2017

This really makes me wish we had an additional plugin for things like this (since it is not something we want in core as-is), but as I mentioned on the call, I think this will be fine for now as long as we keep these things in hotfixes. And maybe add to the GitHub README in a separate PR.

I think a more ideal fix for core would be for the inclusion of the site title to be something that happens as a replacement in the user defined string so that it stays in sync unless the user removes the replacement marker.

function wc_api_dev_email_from_name( $name ) {
return get_bloginfo( 'name', 'display' );
}
add_filter( 'woocommerce_email_from_name', 'wc_api_dev_email_from_name', 20 );
Copy link
Contributor

@allendav allendav Jul 26, 2017

Choose a reason for hiding this comment

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

Why priority 20 here and below? Maybe add a comment why 20 is needed.

Copy link
Contributor

@allendav allendav left a comment

Choose a reason for hiding this comment

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

Works as advertised - one question about filter priority - good to go otherwise - pre-approving

@emdashcodes emdashcodes force-pushed the add/email-filters-fix branch from 303ffb1 to 844c5d9 Compare July 27, 2017 15:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants