Zen Cart Logo
Forums / Addon Admin Tools / Preview Email

Preview Email

Views: 11,971

Results 1 to 20 of 37
2 Nov 2018, 11:23 PM
#1
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Preview Email

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

5 Mar 2020, 12:22 PM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: Preview Email

Preview Email has been updated for Zen Cart 1.5.6.

7 May 2020, 10:36 PM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: Preview Email

More emails have been added.

8 May 2020, 12:09 PM
#4
doomm avatar

doomm

New Zenner

Join Date:
Sep 2008
Posts:
54
Plugin Contributions:
0

Re: Preview Email

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...

8 May 2020, 1:15 PM
#5
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: Preview Email

Great! Please post your results to inspire others!

8 May 2020, 8:40 PM
#6
doomm avatar

doomm

New Zenner

Join Date:
Sep 2008
Posts:
54
Plugin Contributions:
0

Re: Preview Email

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.

18 Jul 2020, 7:49 PM
#7
jodean avatar

jodean

Totally Zenned

Join Date:
May 2011
Location:
Tennessee
Posts:
511
Plugin Contributions:
0

Re: Preview Email

Is the Preview Email plugin compatible with v157?

18 Jul 2020, 8:01 PM
#8
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: Preview Email

Yes it is.

27 Jul 2020, 12:13 PM
#9
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: Preview Email

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.

1 Aug 2020, 2:55 PM
#10
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: Preview Email

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.

21 Jun 2021, 2:59 PM
#11
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: Preview Email

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.)

18 May 2022, 3:08 PM
#12
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,962
Plugin Contributions:
8

Re: Preview Email

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.

23 May 2022, 11:30 AM
#13
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: Preview Email

Updated to fix notices. If you find any more please submit a PR.

25 Oct 2022, 2:29 AM
#14
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Preview Email

ZC 1.5.7
Bootstrap template with OPC

I am getting the following error when trying to preview "checkout email":

[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.

i am also getting this error when trying to preview "welcome email"

[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.

Any assist on resolving these2 erros wouldbe more than appreciated.

All the other options work great.

Thank you

25 Oct 2022, 11:47 AM
#15
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: Preview Email

Yep, there are known issues with OPC interoperability that I haven't fixed yet. Will address ASAP.

26 Oct 2022, 12:52 AM
#16
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: Preview Email

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:

$opc_funcs = DIR_FS_CATALOG . DIR_WS_FUNCTIONS .  '/extra_functions/one_page_checkout_functions.php';
if (file_exists($opc_funcs)) {
   require $opc_funcs;
}

in includes/functions/extra_functions/one_page_checkout_functions.php line 128 change

    $base_language_dir = DIR_WS_LANGUAGES . '/' . $_SESSION['language'] . '/' . $legacy_dir;

to

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;
}
26 Oct 2022, 2:21 AM
#17
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Preview Email

swguy:

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.*)

at the top of admin/includes/functions/extra_functions/preview_email.php add:

$opc_funcs = DIR_FS_CATALOG . DIR_WS_FUNCTIONS . '/extra_functions/one_page_checkout_functions.php';
if (file_exists($opc_funcs)) {
require $opc_funcs;
}

> 
> in includes/functions/extra_functions/one_page_checkout_functions.php line 128 change 
> 
> ```
    $base_language_dir = DIR_WS_LANGUAGES . '/' . $_SESSION['language'] . '/' . $legacy_dir;

to

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;
}


Worked  like a charm. 
:bigups:
Thank you very much for the  fast replies and  fix.
6 Jun 2024, 10:54 AM
#18
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Preview Email

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:

[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.
6 Jun 2024, 2:29 PM
#19
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Re: Preview Email

haven't touched this plugin for a while but it's on my list.

1 Jul 2024, 2:37 AM
#20
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Preview Email

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:

[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.

Thank you for your assistance