```html
<td id = "customerName" style="font:12px Arial,Helvetica,sans-serif;color:#000001;padding:3px 0px 3px 10px">Dear&nbsp;<script>document.getElementById("customerName").innerHTML = custName</script>,</td>    </tr>    <tr>
```

I'm creating an email template for the company I work for. I can't seem to get the JS variable `custName` to display within the HTML snippet id'd `customerName` for a table that I've posted above.

EDIT:

Here is my full HTML code, it is a variable within a Javascript program using SuiteScript API

```js
/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 * @NModuleScope SameAccount
 */
define(['N/email', 'N/record', 'N/search'],function(email, record, search) {
    function beforeLoad(scriptContext) {

    }
    function beforeSubmit(scriptContext) {

    }
    function afterSubmit(scriptContext) {
     var fromId = 450103; // my internal ID
     var recordToSend = record.load({ //Fake Customer
      type: record.Type.CUSTOMER,
      id : 450104, 
      isDynamic: false
     }); 

     var salesOrder = record.load({
      type: record.Type.SALES_ORDER,
      id : 536583,
      isDynamic: false
     }); 

     var department = salesOrder.getValue({
      fieldId : 'department'
     });

     var departmentNames = ['Fire Pits Direct', 'Fireplace Remote Controls', 'Skytech Fireplace Remotes', 'Spotix', 'Kick Ass Grills', 'Teak Furniture Classics']; 
     var deptName = ""; 

     for(var i = 19; i < 25; i++){
      if(i == department){
       deptName = departmentNames[i-19]; 
      }
     }

     var subjectForEmail = "Your Order Has Shipped From "+ deptName + "!"; 
     var custName = "This customer";

     var emailBody = '<center></center>\
      <table style="border:1px black solid;">\
      <tbody><tr><td><img src="http://www.spotix.com/images/email/Spotix-family-stores_horizontal.jpg" alt="Spotix Family of stores" align="middle"></td> </tr><tr><td bgcolor="#ff880f"><span style="padding-bottom:10px;font-weight: bold;font-family: Arial,Helvetica,sans-serif;font-size:28px;line-height: 34px;">&nbsp;&nbsp;&nbsp;Great News! Your order is on the way...</span></td>\
      </tr>    <tr>     <td id = "customerName" style="font:12px Arial,Helvetica,sans-serif;color:#000001;padding:3px 0px 3px 10px">Dear&nbsp;,</td>    </tr>    <tr>\
      <td style="font:12px Arial,Helvetica,sans-serif;color:#000001;padding:3px 0px 3px 10px">We\'ve shipped your {createdfrom}</td>    </tr>    <tr>     <td align="center" bgcolor="#ff880f" style="font-family:Verdana,Arial,Sans-serif;font-size:16px;color:#000000;font-weight: bold;text-align:left;text-decoration:none!important;padding-top:10px;padding-bottom:10px;padding-left:15px;padding-right:15px">Shipping Method - {shipmethod}</td>\
      </tr>    <tr>     <td width="444" align="left" valign="top" style="font:12px Arial,Helvetica,sans-serif;color:#000001;padding:3px 0px 3px 10px" bgcolor="#EEE9E7"><b>Ship To</b></td>    </tr>        <tr>     <td style="font-family:Verdana,Arial,Sans-serif;font-\
      size:12px;color:#000000;text-decoration:none!important;padding-top:10px;padding-bottom:10px;padding-left:15px;padding-right:15px">{shipaddress}<br></td></tr><tr><td width="444" align="left" valign="top" style="font:12px Arial,Helvetica,sans-serif;color:#000001;padding:3px 0px \
      3px 10px" bgcolor="#EEE9E7"><b>Tracking Info</b></td></tr><tr><td style="font-family:Verdana,Arial,Sans-serif;font-size:12px;color:#000000;text-decoration:none!important;padding-top:10px;padding-bottom:10px;padding-left:15px;padding-right:15px">{shipmethod} \
      {trackingnumbers}</td></tr><tr><td width="444" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td width="444" align="left" valign="top"><table border="0" cellpadding="0" cellspacing="0" height="21" width="100%"><tbody><tr><td \
      align="left" bgcolor="#EEE9E7" style="font:12px Arial,Helvetica,sans-serif;color:#000001;padding:3px 0px 3px 10px" valign="bottom"><b>Details</b></td> </tr><tr><td align="left" valign="top" width="262"><span style="font-size: 11px;">QTY:&nbsp;{quantity}</span><span \
      style="font-size: 11px;">&nbsp;SKU:</span>{custcol_item_sku}<span class="Apple-tab-span" style="font-size: 11px; white-space: pre;"></span><span style="font-size: 11px;">&nbsp;ITEM:</span>{item.description}</td></tr></tbody></table></td></tr></tbody></table></td></tr>\
      </tbody></table>Thanks for your order!Questions? Call us now: Mon-Fri 8-5 CST 888.977.6849<img src="http://www.spotix.com/images/email/Benefits-Member_TP.jpg" alt="Spotix benefits" align="middle">\
      <script>document.getElementById("customerName").innerHTML = custName</script>'; 

     email.send({
      author: fromId,
      recipients: fromId,
      subject: subjectForEmail,
      body: emailBody,
      isInternalOnly: false

     }); 

}

    return {
        beforeLoad: beforeLoad,
        beforeSubmit: beforeSubmit,
        afterSubmit: afterSubmit
    };

});
```

```html
var emailBody = '<center></center>\
      <table style="border:1px black solid;">\
      <tbody><tr><td><img src="http://www.spotix.com/images/email/Spotix-family-stores_horizontal.jpg" alt="Spotix Family of stores" align="middle"></td> </tr><tr><td bgcolor="#ff880f"><span style="padding-bottom:10px;font-weight: bold;font-family: Arial,Helvetica,sans-serif;font-size:28px;line-height: 34px;">&nbsp;&nbsp;&nbsp;Great News! Your order is on the way...</span></td>\
      </tr>    <tr>     <td id = "customerName" style="font:12px Arial,Helvetica,sans-serif;color:#000001;padding:3px 0px 3px 10px">Dear&nbsp;,</td>    </tr>    <tr>\
      <td style="font:12px Arial,Helvetica,sans-serif;color:#000001;padding:3px 0px 3px 10px">We\'ve shipped your {createdfrom}</td>    </tr>    <tr>     <td align="center" bgcolor="#ff880f" style="font-family:Verdana,Arial,Sans-serif;font-size:16px;color:#000000;font-weight: bold;text-align:left;text-decoration:none!important;padding-top:10px;padding-bottom:10px;padding-left:15px;padding-right:15px">Shipping Method - {shipmethod}</td>\
      </tr>    <tr>     <td width="444" align="left" valign="top" style="font:12px Arial,Helvetica,sans-serif;color:#000001;padding:3px 0px 3px 10px" bgcolor="#EEE9E7"><b>Ship To</b></td>    </tr>        <tr>     <td style="font-family:Verdana,Arial,Sans-serif;font-\
      size:12px;color:#000000;text-decoration:none!important;padding-top:10px;padding-bottom:10px;padding-left:15px;padding-right:15px">{shipaddress}<br></td></tr><tr><td width="444" align="left" valign="top" style="font:12px Arial,Helvetica,sans-serif;color:#000001;padding:3px 0px \
      3px 10px" bgcolor="#EEE9E7"><b>Tracking Info</b></td></tr><tr><td style="font-family:Verdana,Arial,Sans-serif;font-size:12px;color:#000000;text-decoration:none!important;padding-top:10px;padding-bottom:10px;padding-left:15px;padding-right:15px">{shipmethod} \
      {trackingnumbers}</td></tr><tr><td width="444" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td width="444" align="left" valign="top"><table border="0" cellpadding="0" cellspacing="0" height="21" width="100%"><tbody><tr><td \
      align="left" bgcolor="#EEE9E7" style="font:12px Arial,Helvetica,sans-serif;color:#000001;padding:3px 0px 3px 10px" valign="bottom"><b>Details</b></td> </tr><tr><td align="left" valign="top" width="262"><span style="font-size: 11px;">QTY:&nbsp;{quantity}</span><span \
      style="font-size: 11px;">&nbsp;SKU:</span>{custcol_item_sku}<span class="Apple-tab-span" style="font-size: 11px; white-space: pre;"></span><span style="font-size: 11px;">&nbsp;ITEM:</span>{item.description}</td></tr></tbody></table></td></tr></tbody></table></td></tr>\
      </tbody></table>Thanks for your order!Questions? Call us now: Mon-Fri 8-5 CST 888.977.6849<img src="http://www.spotix.com/images/email/Benefits-Member_TP.jpg" alt="Spotix benefits" align="middle">\
      <script>document.getElementById("customerName").innerHTML = custName</script>';
```