Skip to main content

Transaction Email Templates

Configure automated and manual email templates for NetSuite transactions.


Transaction Template Types

TransactionTemplate LocationTrigger
InvoiceEmail PreferencesManual/Auto on approval
Sales OrderEmail PreferencesOrder confirmation
Estimate/QuoteEmail PreferencesQuote delivery
Purchase OrderEmail PreferencesVendor notification
StatementStatement TemplatesMonthly/On-demand
Payment ReceiptEmail PreferencesPayment confirmation

Configuration

Setup Location

Setup → Company → Email → Email Preferences

Transaction Email Settings

SettingDescription
Default TemplateTemplate used when emailing transaction
Include PDFAttach PDF version
CC/BCCCopy internal recipients
Reply-ToEmail for customer replies
From AddressSender email address

Invoice Email Template

<html>
<head>
<style>
body { font-family: Arial, sans-serif; margin: 0; padding: 0; }
.container { max-width: 600px; margin: 0 auto; }
.header { background: #2c3e50; color: white; padding: 20px; text-align: center; }
.content { padding: 20px; }
.invoice-details { background: #f9f9f9; padding: 15px; margin: 15px 0; }
.items-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.items-table th { background: #34495e; color: white; padding: 10px; text-align: left; }
.items-table td { border-bottom: 1px solid #ddd; padding: 10px; }
.total-row { font-weight: bold; background: #ecf0f1; }
.footer { background: #f5f5f5; padding: 15px; text-align: center; font-size: 12px; }
.btn { background: #3498db; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px; }
</style>
</head>
<body>
<div class="container">
<div class="header">
<img src="${companyinformation.logourl}" alt="Logo" height="50" />
<h2>Invoice #${record.tranid}</h2>
</div>

<div class="content">
<p>Dear ${entity.firstname} ${entity.lastname},</p>
<p>Please find your invoice details below:</p>

<div class="invoice-details">
<table>
<tr>
<td><strong>Invoice Number:</strong></td>
<td>${record.tranid}</td>
</tr>
<tr>
<td><strong>Invoice Date:</strong></td>
<td>${record.trandate}</td>
</tr>
<tr>
<td><strong>Due Date:</strong></td>
<td>${record.duedate}</td>
</tr>
<tr>
<td><strong>Terms:</strong></td>
<td>${record.terms}</td>
</tr>
</table>
</div>

<table class="items-table">
<thead>
<tr>
<th>Item</th>
<th>Description</th>
<th>Qty</th>
<th>Rate</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<#list record.item as line>
<tr>
<td>${line.item}</td>
<td>${line.description}</td>
<td>${line.quantity}</td>
<td>${line.rate}</td>
<td>${line.amount}</td>
</tr>
</#list>
<tr class="total-row">
<td colspan="4" style="text-align: right;">Subtotal:</td>
<td>${record.subtotal}</td>
</tr>
<tr class="total-row">
<td colspan="4" style="text-align: right;">Tax:</td>
<td>${record.taxtotal}</td>
</tr>
<tr class="total-row">
<td colspan="4" style="text-align: right;"><strong>Total Due:</strong></td>
<td><strong>${record.total}</strong></td>
</tr>
</tbody>
</table>

<p style="text-align: center;">
<a href="${record.paymentlink}" class="btn">Pay Now</a>
</p>
</div>

<div class="footer">
<p>${companyinformation.companyname}</p>
<p>${companyinformation.mainaddress}</p>
<p>Phone: ${companyinformation.phone} | Email: ${companyinformation.email}</p>
</div>
</div>
</body>
</html>

Sales Order Confirmation

<html>
<body>
<h2>Order Confirmation - #${record.tranid}</h2>

<p>Dear ${entity.firstname},</p>
<p>Thank you for your order! Here are your order details:</p>

<h3>Order Summary</h3>
<table border="1" cellpadding="5" style="border-collapse: collapse;">
<tr>
<th>Order Number</th>
<td>${record.tranid}</td>
</tr>
<tr>
<th>Order Date</th>
<td>${record.trandate}</td>
</tr>
<tr>
<th>Expected Ship Date</th>
<td>${record.shipdate}</td>
</tr>
</table>

<h3>Items Ordered</h3>
<table border="1" cellpadding="5" style="border-collapse: collapse; width: 100%;">
<tr style="background: #f0f0f0;">
<th>Item</th>
<th>Qty</th>
<th>Price</th>
</tr>
<#list record.item as line>
<tr>
<td>${line.item}</td>
<td>${line.quantity}</td>
<td>${line.amount}</td>
</tr>
</#list>
</table>

<h3>Shipping To</h3>
<p>${record.shipaddress}</p>

<p>We'll notify you when your order ships.</p>

<p>Thank you for your business!</p>
</body>
</html>

Purchase Order to Vendor

<html>
<body>
<h2>Purchase Order #${record.tranid}</h2>

<p>Dear ${entity.companyname},</p>
<p>Please find our purchase order below:</p>

<table border="1" cellpadding="5" style="border-collapse: collapse;">
<tr>
<th>PO Number</th>
<td>${record.tranid}</td>
</tr>
<tr>
<th>Date</th>
<td>${record.trandate}</td>
</tr>
<tr>
<th>Required By</th>
<td>${record.duedate}</td>
</tr>
<tr>
<th>Ship To</th>
<td>${record.shipaddress}</td>
</tr>
</table>

<h3>Order Lines</h3>
<table border="1" cellpadding="5" style="border-collapse: collapse; width: 100%;">
<tr style="background: #f0f0f0;">
<th>Item Code</th>
<th>Description</th>
<th>Qty</th>
<th>Unit Price</th>
<th>Amount</th>
</tr>
<#list record.item as line>
<tr>
<td>${line.item}</td>
<td>${line.description}</td>
<td>${line.quantity}</td>
<td>${line.rate}</td>
<td>${line.amount}</td>
</tr>
</#list>
<tr style="font-weight: bold;">
<td colspan="4" style="text-align: right;">Total:</td>
<td>${record.total}</td>
</tr>
</table>

<p>Please confirm receipt of this order and expected delivery date.</p>

<p>Regards,<br/>${currentuser.firstname} ${currentuser.lastname}<br/>${companyinformation.companyname}</p>
</body>
</html>

Attaching PDF

Auto-Attach Settings

Setup → Company → Email → Email Preferences

OptionDescription
Attach Transaction PDFInclude PDF with email
PDF TemplateWhich Advanced PDF template to use
Attach FilesInclude related File Cabinet files

SuiteScript PDF Attachment

/**
* @NApiVersion 2.1
* @NScriptType UserEventScript
*/
define(['N/email', 'N/render', 'N/record', 'N/runtime'],
(email, render, record, runtime) => {

const afterSubmit = (context) => {
if (context.type !== context.UserEventType.CREATE) return;

const invoiceId = context.newRecord.id;
const invoiceRec = record.load({ type: 'invoice', id: invoiceId });

// Generate PDF
const pdfFile = render.transaction({
entityId: invoiceId,
printMode: render.PrintMode.PDF
});

// Send email with PDF
email.send({
author: runtime.getCurrentUser().id,
recipients: invoiceRec.getValue('email'),
subject: `Invoice #${invoiceRec.getValue('tranid')}`,
body: 'Please find your invoice attached.',
attachments: [pdfFile],
relatedRecords: {
transactionId: invoiceId
}
});
};

return { afterSubmit };
});

Conditional Content

FreeMarker Conditionals

<#if record.amountremaining gt 0>
<p style="color: red;">
<strong>Amount Due: ${record.amountremaining}</strong>
</p>
<#else>
<p style="color: green;">
<strong>PAID IN FULL</strong>
</p>
</#if>

<#if record.shipmethod?has_content>
<p>Shipping Method: ${record.shipmethod}</p>
</#if>

<#if entity.category == "VIP">
<p>Thank you for being a valued VIP customer!</p>
</#if>

See Also