【发布时间】:2017-09-19 19:16:27
【问题描述】:
您好,我正在为我的工作场所更新电子邮件模板。以下代码以红色打印出“customer.overdueBalance”变量。我需要帮助获得一个 if else 语句,当值为零时,该余额将打印为绿色,并在有余额到期时打印红色。
Russell Pacific | Invoice ${transaction.tranId}
<span style="background-color: rgb(255, 255, 255);">Hello Accounts Payable,</span><br />
<br />
<span style="background-color: rgb(255, 255, 255);">Attached is your invoice, ${transaction.tranId}, for ${transaction.createdfrom}, from ${customer.companyName} PO ${transaction.custbody3}.</span><br />
<br />
Date Due: ${transaction.dueDate}<br />
Amount Due: ${transaction.total}<br />
<br />
<u><strong>Current Financial Snapshot</strong></u><br />
<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;">
<tbody>
<tr>
<td><strong><span style="background-color: rgb(255, 255, 255);">Total Balance:</span></strong></td>
<td><strong><span style="background-color: rgb(255, 255, 255);"> ${customer.balance}</span></strong></td>
</tr>
<tr>
<td><strong><span style="background-color: rgb(255, 255, 255);">Balance Past Due:</span></strong></td>
<td><span style="color: rgb(255, 0, 0);"><strong><span style="background-color: rgb(255, 255, 255);"> ${customer.overdueBalance}</span></strong></span></td>
</tr>
</tbody>
</table>
<br />
<br />
<span style="background-color: rgb(255, 255, 255);">If you have any questions, please do not hesitate to contact us.</span><br />
<br />
<span style="background-color: rgb(255, 255, 255);">Best Regards, </span><br />
<span style="background-color: rgb(255, 255, 255);">${preferences.MESSAGE_SIGNATURE}</span>
对于 RGB 通道绿色,175 可以工作
【问题讨论】:
-
如何确定 ${transaction.custbody3} 的数据类型?这将打印出采购订单编号,但如果没有编号,我不想打印任何内容。这将是另一个 if 语句,但我的猜测是数据类型是字符串?这是否意味着我会检查变量是否为空?任何帮助都会很棒。
标签: html email templates netsuite