fix: email variable replacement + icon URL path
1. Added missing base variables in get_variables(): - site_name, site_title, store_name - shop_url, my_account_url - support_email, current_year 2. Fixed social icon URL path calculation: - Was using 3x dirname which pointed to 'includes/' not plugin root - Now uses WOONOOW_URL constant or correct 4x dirname 3. Added px-6 padding to EmailBuilder dialog body 4. Added portal container to Select component for CSS scoping
This commit is contained in:
@@ -140,9 +140,12 @@ class EmailRenderer {
|
||||
*/
|
||||
private function get_variables($event_id, $data, $extra_data = []) {
|
||||
$variables = [
|
||||
'site_name' => get_bloginfo('name'),
|
||||
'site_title' => get_bloginfo('name'),
|
||||
'store_name' => get_bloginfo('name'),
|
||||
'store_url' => home_url(),
|
||||
'site_title' => get_bloginfo('name'),
|
||||
'shop_url' => get_permalink(wc_get_page_id('shop')),
|
||||
'my_account_url' => get_permalink(wc_get_page_id('myaccount')),
|
||||
'support_email' => get_option('admin_email'),
|
||||
'current_year' => date('Y'),
|
||||
];
|
||||
@@ -611,8 +614,13 @@ class EmailRenderer {
|
||||
* @return string
|
||||
*/
|
||||
private function get_social_icon_url($platform, $color = 'white') {
|
||||
// Use local PNG icons
|
||||
$plugin_url = plugin_dir_url(dirname(dirname(dirname(__FILE__))));
|
||||
// Use plugin URL constant if available, otherwise calculate from file path
|
||||
if (defined('WOONOOW_URL')) {
|
||||
$plugin_url = WOONOOW_URL;
|
||||
} else {
|
||||
// File is at includes/Core/Notifications/EmailRenderer.php - need 4 levels up
|
||||
$plugin_url = plugin_dir_url(dirname(dirname(dirname(dirname(__FILE__)))));
|
||||
}
|
||||
$filename = sprintf('mage--%s-%s.png', $platform, $color);
|
||||
return $plugin_url . 'assets/icons/' . $filename;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user