XAMPP: Debugging Email Messages

 hints, troubleshoot  Comments Off on XAMPP: Debugging Email Messages
Jul 262015
 

I use XAMPP to host my local pre-staging test environments and I don’t install the Mercury e-mail server since it doesn’t “play nice” with Outlook (or maybe it’s the other way around).  That said, it’s always been a challenge to debug customizations I’m creating that include e-mail changes.

I was recently trolling through my c:/xampp folder and came across c:/xampp/mailoutput.  This folder contains a bunch of mail-*.txt files, one for every email group ever sent from one of my locally-hosted sites!

If a page’s action sent multiple email messages, those messages are concatenated within a single mail-*.txt file.  The beauty of this is that the HTML emails are captured as (er) HTML1 so that you can cut the HTML section out to a new file and display it in your web browser for validation.

Now, I can get rid of all the test-only changes that I’ve made to Zen Cart’s zen_mail function and still debug/validate the email output that’s being generated.


1Unlike the method that Zen Cart uses to store the HTML emails in the database, replacing the HTML tags’ starting (<) and ending (>) characters with an underscore (_) which makes the stored information relatively useless as a means of determining how the message will be viewed.

Debugging session-handling scripts in Zen Cart

 hints, troubleshoot, zen-cart  Comments Off on Debugging session-handling scripts in Zen Cart
May 182014
 

It can be a pain debugging session-based scripts.  Once a variable is incorrectly set into the session, you need a way to just start over!

Zen Cart’s logoff page kills the current session and, subsequently, resets all session-based variables.  If you’re not currently logged into your test site, login, and then click your site’s link to the logoff page.  Now your session variables are back to square one and your debug activities can continue.

PHP Parse error: syntax error, unexpected T_STRING

 php, troubleshoot  Comments Off on PHP Parse error: syntax error, unexpected T_STRING
Apr 202014
 

I was updating a plugin a while ago and received the subject PHP parse error.  I must have looked at the referenced source-code line a million times:

define('EMAIL_SUBJECT_APPROVED', 'Approved: ' . STORE NAME . ' referrer account');

before I realized that I’d blanked out an underscore in the definition:

define('EMAIL_SUBJECT_APPROVED', 'Approved: ' . STORE_NAME . ' referrer account');

I’ll be paying more attention to those missing underscores in the future!