ExeSSI calls in HTML email attachments not rendering correctly

I have scoured the forums and found several posts that are similar or tangentially related, but I am still unable to solve this problem.

Previously, my company has created bespoke reports for our customers that are sent out at the end of a shift. The reports basically summarize the machine’s performance during the shift, such as parts made, times stopped, etc. To do this, we have been using .html template files with TagSSI and ParamSSI syntax. These template files are filled out and sent via email using the SENDMAIL command and Export Block Descriptor functionality of the BASIC script available on the EWON. These have worked with no problem.

However, given the fact that we support a variety of machines from multiple manufacturers, up until now, there has been neither a unified BASIC code base nor a unified template file that works on all machines. This is obviously not ideal because that means there is a custom template and custom BASIC script for each machine, and given the number of machines, there are many versions of code floating around. My job has been to rewrite the BASIC code in such a way that it is universal to all the machines that we support, which I have accomplished. More recently, I have been tasked with also creating a universal template file that will work across all the machines that we support. This is where I am running into problems.

Since the shift report templates are very similar across machines and vary only in certain tag names, I have built off of the previous HTML templates. In order to account for different possible machines, I have incorporated conditional statements into the HTML templates by using ExeSSI sections that check for various conditions. These HTML files are no longer functioning as intended. While the TagSSI calls are still filled in with their corresponding tag values, ALL ExeSSI sections fail to execute.

After looking into the documentation, specifically the EWON Web Reference Guide, I began to suspect that the problems may have to do with the template report file extension. According to the linked reference guide, section 1.2.1 says:

• The server checks the page extension (here .shtm), if this extension is NOT .shtm the page is transferred as-is to the client.
This applies to .htm files for example, but also .jpg, .gif, etc.
• If the page’s extension is .shtm, then server will parse the page and replace all the special HTML Tags (see below) by there current value.
So the SSI extension for the pages in the eWON is .shtm (case sensitive). This extension is recognized by most HTML editors

This makes it sound as if a .html extension file will NOT work with any SSI calls, although the shift report template files we have been using so far with TagSSI calls and ParamSSI calls are all .html extension files, and they have rendered properly. However, since these old shift report template files never incorporated ExeSSI calls, for the sake of experimentation, I converted the .html shift report template file to a .shtm file and attempted to email it using an email function I have created in the BASIC code, shown here (tag and file names changed for security purposes):

// Function call
@test_email$()

// Function to send emails to appropriate recipients
FUNCTION test_email$()
// Initialize local variables
$subject$ = MachSerialNum@ + " - OEE Report" + ShiftDesignation@
$attachment$ = “&[$dtUF $fnReportTemplate.shtm]”
$body$ = “Test body.”
SENDMAIL “myemail@companydomain.com”,"", $subject$, $attachment$ + $body$
// Create a 100 second timer to wait for emails to send
@wait_timer$(3, 100)
PRINT “SENT”
RETURN
ENDFN

// Function to create a timer and wait until the timer elapses to return
FUNCTION wait_timer$($timer_id, $length)
TSET $timer_id, $length
$TimerWait:
IF NOT TGET $timer_id THEN
GOTO $TimerWait
ELSE
RETURN
ENDIF
ENDFN

These email attempts were tried in 3 separate ways, detailed below:

  1. Sending the .shtm file ("&[$dtUF $fnReportTemplate.shtm]") shows a successful email in the Scheduled Actions log, but the email never arrives. This error is shown in the error log:
    | Event | Description | Originator |
    | :–: | :–: | :–: |
    | 21000 | east-Invalid Parser name in InitSSI | unact |
  2. Sending the .html file ("&[$dtUF $fnReportTemplate.html]") shows a successful email in the Scheduled Actions log, and the email DOES arrive. However, any section of the template containing ExeSSI calls is not rendered. The same error is shown in the error log:
    | Event | Description | Originator |
    | :–: | :–: | :–: |
    | 21000 | east-Invalid Parser name in InitSSI | unact |
  3. Sending the .shtm file but renaming it to an .html file ("&[$dtUF $uf/ReportTemplate.shtm $fnReportTemplate.html]") shows a successful email in the Scheduled Actions log, and the email DOES arrive. However, any section of the template containing ExeSSI calls is not rendered. The same error is shown in the error log:
    | Event | Description | Originator |
    | :–: | :–: | :–: |
    | 21000 | east-Invalid Parser name in InitSSI | unact |

Occasionally, this error also shows up, but seemingly only when the file is a .html extension file:

Event Description Originator
23613 exp-The SSI parameter in the user file call is invalid unact

What I have tried:

  1. Navigated directly to EWON-IP-ADDRESS/usr/ReportTemplate.shtm. The ExeSSI blocks DO render correctly, and no errors are thrown in the error log. This is identical to the behavior detailed in this forum post and this forum post.
  2. Set the SSIOutputMode configuration variable to 0, as per this forum post.
  3. Changed the duration of the timer created after the SENDMAIL call.
  4. Removed the timer after the SENDMAIL call.
  5. Ruled out any possible interference from TagSSI or ParamSSI calls by deleting everything from the .shtm file except for the ExeSSI call, such that the entirety of the .shtm file looks like this:
Label: <%#ExeSSI, rem Example comment if MachineModel@ = "ModelA" then print #0,"testing"; endif %>

The ExeSSI sections are still not rendering when emailed, and searching the errors thrown leads me to the exact same 4 or 5 forum posts, none of which have been able to solve the problem.

We investigated this in a ticket the customer submitted. ExeSSI statements are not supported for sending emails, only for making webpages that are hosted by the Ewon. For sending custom reports, TagSSI and ParamSSI statements must be used instead.