Preview Email allows you to view the HTML emails your cart produces, so you can tweak the layout.
It's available here: https://www.zen-cart.com/downloads.php?do=file&id=2220
Printable View
Preview Email allows you to view the HTML emails your cart produces, so you can tweak the layout.
It's available here: https://www.zen-cart.com/downloads.php?do=file&id=2220
Preview Email has been updated for Zen Cart 1.5.6.
More emails have been added.
Awesome contribution - should be a core part of the cart,
thanks to his, I´m finally changing my e-mail templates after 10 years of living with the old one...
Great! Please post your results to inspire others!
So far, I have used your own tutorial from your site, so it´s basically the same as yours,
but this is already a great improvement and emails (working on second, right now) look more neatly than ever before! Plus, finally, I´ve found time to change the old translations to my own language, so it´s really more professional, thanks to your mod.
Is the Preview Email plugin compatible with v157?
Yes it is.
If you are testing the Direct Email (sent by Admin > Tools > Send Email), note that one small change is required: in the switch statement in admin/preview_email.php around line 58 change
$module = 'direct';
to
$module = 'direct_email';
This issue will be fixed in the next update, coming in August.
Because the direct email doesn't have any content other than what you provide, Preview Email has been updated to allow you to define a file (called direct_test.html) to use when testing. This content will be displayed according to the rules and template you have provided.
The Back in Stock email functionality has been extended to support Ceon's implementation of Back in Stock. (Originally, only Larry Bislew's version was supported.)
build_gv_email() has a lot of undefined notices.
$css_lang_folder is undefined.
it really would be nice if this plugin did NOT generate error logs out of the box with a vanilla 157 install.
best.
Updated to fix notices. If you find any more please submit a PR.
ZC 1.5.7
Bootstrap template with OPC
I am getting the following error when trying to preview "checkout email":
i am also getting this error when trying to preview "welcome email"Quote:
[25-Oct-2022 02:22:23 UTC] PHP Fatal error: Call to undefined function opc_load_legacy_language_definitions() in /includes/languages/english/checkout_process_guest.php on line 12
[25-Oct-2022 02:22:23 UTC] Request URI: /sweety/index.php?cmd=preview_email, IP address: 76.103.115.109
--> PHP Fatal error: Call to undefined function opc_load_legacy_language_definitions() in /includes/languages/english/checkout_process_guest.php on line 12.
Any assist on resolving these2 erros wouldbe more than appreciated.Quote:
[25-Oct-2022 02:26:21 UTC] PHP Fatal error: Call to undefined function opc_load_legacy_language_definitions() in /includes/languages/english/create_account_register.php on line 12
[25-Oct-2022 02:26:21 UTC] Request URI: /sweety/index.php?cmd=preview_email, IP address: 76.103.115.109
--> PHP Fatal error: Call to undefined function opc_load_legacy_language_definitions() in /includes/languages/english/create_account_register.php on line 12.
All the other options work great.
Thank you
Yep, there are known issues with OPC interoperability that I haven't fixed yet. Will address ASAP.
OK here's what you have to do for newer versions of OPC that have the 1.5.8 style language files (the ones whose names start with lang.*)
Note that this is for Zen Cart 1.5.7 only - the 1.5.8 plugin will require significant rework.
at the top of admin/includes/functions/extra_functions/preview_email.php add:
in includes/functions/extra_functions/one_page_checkout_functions.php line 128 changeCode:$opc_funcs = DIR_FS_CATALOG . DIR_WS_FUNCTIONS . '/extra_functions/one_page_checkout_functions.php';
if (file_exists($opc_funcs)) {
require $opc_funcs;
}
toCode:$base_language_dir = DIR_WS_LANGUAGES . '/' . $_SESSION['language'] . '/' . $legacy_dir;
Code:if (!defined('IS_ADMIN_FLAG') || IS_ADMIN_FLAG !== true) {
$base_language_dir = DIR_WS_LANGUAGES . '/' . $_SESSION['language'] . '/' . $legacy_dir;
} else {
$base_language_dir = DIR_FS_CATALOG_LANGUAGES . '/' . $_SESSION['language'] . '/' . $legacy_dir;
}
ZC v1.5.8a
PHP v8.3.7
I thought that simply redefining the language file location from /email_extras.php to /lang.email_extras.php would be enough to get this working with ZC v1.5.8a. While doing so enabled me to access the Admin > Customers > Preview Email page, more work is needed I think as I get this blank page error when trying to preview an email template:
Code:[06-Jun-2024 11:31:26 Europe/London] Request URI: /MY_ADMIN/index.php?cmd=preview_email, IP address: 127.0.0.1, Language id 1
#0 D:\wamp64\www\MY_DOMAIN.co.uk\includes\modules\require_languages.php(13): zen_debug_error_handler()
#1 D:\wamp64\www\MY_DOMAIN.co.uk\MY_ADMIN\includes\functions\extra_functions\preview_email.php(251): require('D:\\wamp64\\www\\k...')
#2 D:\wamp64\www\MY_DOMAIN.co.uk\MY_ADMIN\preview_email.php(58): build_checkout_email()
#3 D:\wamp64\www\MY_DOMAIN.co.uk\MY_ADMIN\index.php(11): require('D:\\wamp64\\www\\k...')
--> PHP Warning: Undefined variable $languageLoader in D:\wamp64\www\MY_DOMAIN.co.uk\includes\modules\require_languages.php on line 13.
[06-Jun-2024 11:31:26 Europe/London] PHP Fatal error: Uncaught Error: Call to a member function setCurrentPage() on null in D:\wamp64\www\MY_DOMAIN.co.uk\includes\modules\require_languages.php:13
Stack trace:
#0 D:\wamp64\www\MY_DOMAIN.co.uk\MY_ADMIN\includes\functions\extra_functions\preview_email.php(251): require()
#1 D:\wamp64\www\MY_DOMAIN.co.uk\MY_ADMIN\preview_email.php(58): build_checkout_email()
#2 D:\wamp64\www\MY_DOMAIN.co.uk\MY_ADMIN\index.php(11): require('D:\\wamp64\\www\\k...')
#3 {main}
thrown in D:\wamp64\www\MY_DOMAIN.co.uk\includes\modules\require_languages.php on line 13
[06-Jun-2024 11:31:26 Europe/London] Request URI: /MY_ADMIN/index.php?cmd=preview_email, IP address: 127.0.0.1
--> PHP Fatal error: Uncaught Error: Call to a member function setCurrentPage() on null in D:\wamp64\www\MY_DOMAIN.co.uk\includes\modules\require_languages.php:13
Stack trace:
#0 D:\wamp64\www\MY_DOMAIN.co.uk\MY_ADMIN\includes\functions\extra_functions\preview_email.php(251): require()
#1 D:\wamp64\www\MY_DOMAIN.co.uk\MY_ADMIN\preview_email.php(58): build_checkout_email()
#2 D:\wamp64\www\MY_DOMAIN.co.uk\MY_ADMIN\index.php(11): require('D:\\wamp64\\www\\k...')
#3 {main}
thrown in D:\wamp64\www\MY_DOMAIN.co.uk\includes\modules\require_languages.php on line 13.
haven't touched this plugin for a while but it's on my list.
Anyone got this plugin to work with ZC 2.0.1?
On my test upgrade site, I am getting an error 500 when trying to preview any of emails option.
Logs are as follow:
Thank you for your assistanceCode:[01-Jul-2024 02:25:28 UTC] Request URI: /upgrade/sweety/index.php?cmd=preview_email, IP address: 24.4.88.128, Language id 1
#0 /includes/modules/require_languages.php(13): zen_debug_error_handler()
#1 /sweety/includes/functions/extra_functions/preview_email.php(232): require('/home/zch1akhw6...')
#2 /sweety/preview_email.php(102): build_welcome_email()
#3 /sweety/index.php(16): require('/home/zch1akhw6...')
--> PHP Warning: Undefined variable $languageLoader in /includes/modules/require_languages.php on line 13.
[01-Jul-2024 02:25:28 UTC] PHP Fatal error: Uncaught Error: Call to a member function setCurrentPage() on null in /includes/modules/require_languages.php:13
Stack trace:
#0 /sweety/includes/functions/extra_functions/preview_email.php(232): require()
#1 /sweety/preview_email.php(102): build_welcome_email()
#2 /sweety/index.php(16): require('/home/zch1akhw6...')
#3 {main}
thrown in /includes/modules/require_languages.php on line 13
[01-Jul-2024 02:25:28 UTC] Request URI: /upgrade/sweety/index.php?cmd=preview_email, IP address: 24.4.88.128
--> PHP Fatal error: Uncaught Error: Call to a member function setCurrentPage() on null in /includes/modules/require_languages.php:13
Stack trace:
#0 /sweety/includes/functions/extra_functions/preview_email.php(232): require()
#1 /sweety/preview_email.php(102): build_welcome_email()
#2 /sweety/index.php(16): require('/home/zch1akhw6...')
#3 {main}
thrown in /includes/modules/require_languages.php on line 13.
[01-Jul-2024 02:25:28 UTC] Request URI: /upgrade/sweety/index.php?cmd=preview_email, IP address: 24.4.88.128
--> PHP Fatal error: Uncaught Error: Call to a member function setCurrentPage() on null in /includes/modules/require_languages.php:13
Stack trace:
#0 /sweety/includes/functions/extra_functions/preview_email.php(232): require()
#1 /sweety/preview_email.php(102): build_welcome_email()
#2 /sweety/index.php(16): require('/home/zch1akhw6...')
#3 {main}
thrown in /includes/modules/require_languages.php on line 13.
This is still on my list. Will update ASAP.
OK Github is up to date now for the 1.5.8/2.0.x version of this plugin.
https://github.com/scottcwilson/zencart_preview_email/
Updated in the Plugins Library.
ZC v1.5.8a & ZC v2.0.1
Preview Email v2.0
E.g. Previewing the Welcome Email
The content is populated from the defines in \includes\languages\english\lang.create_account.php even when there is an override at \includes\languages\english\MY_TEMPLATE\lang.create_account.php
How do I ensure the template override file is used?
Fixed in Github. Please retest.
Dutch translation (in you're admin folder):
DirkS