-
Notifications
You must be signed in to change notification settings - Fork 19
Overwrite order URL for admins in order details emails #34
Conversation
a2493f8 to
bc562ef
Compare
bfca28e to
0ca1d3f
Compare
5de4834 to
ad3596c
Compare
ryelle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment about the URL builder, but otherwise it seemed to test OK.
My api-dev test site is just pressable, not AT, so I got redirected back to /stats/ when I clicked the email links, but if I switched them to wpcalypso they're fine.
| } | ||
|
|
||
| function wc_api_dev_email_get_wpcom_order_link( $order_id ) { | ||
| $site_slug = preg_replace( '/^https?:\/\//', '', get_site_url() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not something to worry about immediately, but this won't work for URLs where WP is in a subfolder. You can steal Jetpack's build_raw_urls function though (and it looks like this is usually passed get_home_url, not get_site_url).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch and suggestion. I think it's a good idea to handle this now so we don't run into issues later.
|
I'll re-open this after the plugin split. |
… link to point to WordPress.com.
56d0cf5 to
35d1f2c
Compare
35d1f2c to
84e543c
Compare
|
@ryelle I made the change that should allow for sites w/ paths later on. Can you take a look/test and ✅ if everything looks good? |
ryelle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good 👍 I don't actually have a subfolder site to test on, but I know that pattern works for jetpack, so I think you're good to merge
See Automattic/wp-calypso#16660.
The emails being sent to the store admin (which is also our only notification right now) links to
wp-admininstead of Calypso. This PR adds a hotfix for overwriting the templates with our own, linking to WP.com.To Test:
wc-api-devplugin.wp-admin > WooCommerce > Settings > Emails > New Orderand then set it to plaintext.