Email Template Problem

General ShopSite user discussion

Email Template Problem

Postby crowco » Sat Jan 13, 2007 12:12 am

Can someone please tell me why this code does not display the javascript link in the customer email?

I have the same code segment in the thank you page definition. and works perfectly.

Following is a code segment from my shopping cart templete.
Code: Select all
#############################
[-- DEFINE ThankYou_Email --]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
# ShopSite Classic Thank You E-Mail Template

<html>
<head>

<title>[-- STORE.SC_ThankYou Remove_Html --]</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" language="JavaScript">
<!--
# Tag for ShopSite's required Java Script code
[-- SC_JAVASCRIPT extras --]
// -->
</script>

[-- INCLUDE sc_thankyouemail.css PROCESS --]

</head>

<body
bgcolor="#[--STORE.SC_BackgroundColor--]"
[-- IF STORE.SC_BackgroundImage --]
  background="[--STORE.SC_BackgroundImage--]"
[-- END_IF --]
    >

<p class="buttons">[-- ThankYouReturnStore --]</p>

<div class="header">[-- ThankYouHeader --]</div>

<table border="0" width="0" align="center">

  <tr>
    <td align="center">
      <b>[--Store.SC_OrderNumber--]&nbsp;[-- ThankYouOrderNumber --]</b>
    </td>
  </tr>

  <tr>
    <td align="right">
    [-- SC_Cart --]
    </td>
  </tr>

  <tr>
    <td align="right">
    [-- SC_Totals --]
    </td>
  </tr>

  <tr><td align="center"><hr noshade size="2"></td></tr>

 

  <tr>
    <td align="center">
      [-- SC_Address --]
    </td>
  </tr>

  <tr><td align="center"><hr noshade size="2"></td></tr>

  <tr>
    <td align="center">
      [-- SC_Payment --]
    </td>
    <tr>
    <td></td>
  </tr>
 
  <tr>
  <td>
<script type="text/javascript" language="JavaScript">
<!--
for (i = 0; i < number_products; i++) {
         if (ss_name[i].match(TEST PRODUCT)) {
             document.write("<a href=\"http://www.europeanbeautysecrets.com/eBook_Download_Instructions.html\">CLICK HERE for Download and Installation Instructions</a><BR><BR>");
         }
}
// -->
</script>
<br>
</td>
  </tr>
  <tr><td align="center"><hr noshade size="2"></td></tr>

   [-- VAR.HR No --]
   [-- IF SC_OrderingInstructions_Text --]
  <tr>
    <td align="center">
      [-- SC_OrderingInstructions --]
    </td>
  </tr>
  [-- VAR.HR Yes --]
  [-- END_IF --]
  [-- IF SC_Comments_Text --]
  <tr>
    <td align="center">
      [-- SC_Comments --]
    </td>
    <tr>
        <td align="center">
      [-- SC_Payment --]
    </td>
  </tr>

  <tr><td align="center"><hr noshade size="2"></td></tr>
  </tr>
  [-- VAR.HR Yes --]
  [-- END_IF --]
  [-- IF CustomHTML_Values --]
  <tr>
    <td align="center">
      <table align="center">
        <tr>
          <td align="left">
            [-- CustomHTML_Values --]
          </td>
        </tr>
      </table>
    </td>
  </tr>
  [-- VAR.HR Yes --]
  [-- END_IF --]
  [-- IF Email_List --]
  <tr>
    <td align="center">
      [-- Email_List --]
    </td>
  </tr>
  [-- VAR.HR Yes --]
  [-- END_IF --]
  [-- IF VAR.HR Yes --]
  [-- END_IF --]
  <tr><td align="center"><hr noshade size="2"></td></tr>

</table>

<div class="footer">
[-- ReceiptFooter --]
</div>

</body>
</html>
[-- END_DEFINE ThankYou_Email --]



I have also tried to get the code to run in the thank you Text at the bottom
of the email receipt.

Thank you in advance for your assistance.

Craig
crowco
 
Posts: 5
Joined: Mon Jan 08, 2007 4:11 pm

Postby robm » Sat Jan 13, 2007 6:08 pm

Javascript in html emails is tough to do, as many email programs disable it. You may want to think of a different way to do this for the email receipt. Here is a great article about HTML emails:

http://www.sitepoint.com/article/code-h ... ewsletters

Pertinent snippet:

In addition, the following best practices are recommended:
Avoid using JavaScript. Most email software will disable it anyway.
robm
 
Posts: 463
Joined: Fri Aug 04, 2006 5:46 pm
Location: Connecticut

Custom HTML Email Template

Postby crowco » Sat Jan 13, 2007 7:38 pm

Thanks Rob,

I spent about 12 hours trying to make it and came to the same conclusion. I ended up using straight html to display the link. Not what I really wanted but it seems like the way to do it..

Thanks for the link. I could have used it 2 days ago. But now I know.


Craig
crowco
 
Posts: 5
Joined: Mon Jan 08, 2007 4:11 pm


Return to User Forum

Who is online

Users browsing this forum: No registered users and 94 guests

cron