Personalization field to include URL not working?

Avatar

Avatar

SonnyRD

Avatar

SonnyRD

SonnyRD

03-10-2017

Hello--

I have a personalization field in my email template to include a URL, like this:

<%@ include file='http://www.google.com' %>

However when I run the preview, I am getting the following error:

Error while evaluating document

BAS-010014 Cannot open file '/usr/local/neolane/nl6/var/www.google.com' with read access (errno=2, No such file or directory)

JST-310008 Failed to process directives '<%@ include' (content htmlContent).

Interestingly, if I have an https link, e.g.,

<%@ include file='https://www.google.com' %>

the error message changes slightly:

Error while evaluating document

DLV-490143 Cannot open file '/www.google.com'

JST-310008 Failed to process directives '<%@ include' (content htmlContent).

Does anyone have any idea what could be wrong? It worked before in build 8795 and we just upgraded to 8883, so I'm pretty sure it's related to an update.

Thanks,

Sonny

View Entire Topic

Avatar

Avatar

SonnyRD

Avatar

SonnyRD

SonnyRD

04-10-2017

Hi Jean-Serge--

I don't fully understand what the code does, but it looks like it's grabbing whatever is in the URL (which in this case contains the web version of a daily newsletter) and writes the full HTML code of that web page into the email template during execution.

Here is the code that's in the email template:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<HEAD>

</HEAD>

<BODY>

<% document.startBuffering(); %>

<%@ include file='(sample newsletter content URL here)'%>

<%

  var dte= formatDate(new Date(), "%ail, %bil %2D, %4Y");

  var html = document.stopBuffering();

  html = html.replace(/(\r\n|\n|\r)/gm, "");

  html = html.replace(/<\$\$ RECIPIENT \$\$>/g, recipient.id);

  html = html.replace('Sample Newsletter', dte);

  // Get body style

  var bodyTmp = /<body[^>]+style=\".*?\"/.exec(html)

  var bodyStyle = /style=\".*?\"/.exec(bodyTmp)

  // Get title

  var title = /<title>[^<]+<\/title>/.exec(html)

  // Get body

  var body = html.replace(/.*<body.*?>(.+)<\/body>.*/ig, '$1');

%>

<%= title %>

<STYLE type=text/css>

(CSS here)

</STYLE>

<% document.write(body); %>

</BODY>

</HTML>

I suspect that something has changed after v6 8795 (our last build before upgrading to 8883 this week). The base URL of the link referenced in the include file has already been added by Support/TechOps to our serverConf.xml due to the enhanced security around using URLs, but we're not sure why this particular issue persists.

Thanks,

Sonny