Skip to main content
Solved

If statement for Tracking Numbers on an Email Template of Shipment Confirmation

  • January 10, 2025
  • 2 replies
  • 58 views

Forum|alt.badge.img

Hello,

Would someone kindly be able to assist me in creating an HTML If statement for an Email Template. I am used to creating them in Report Designer, and not in the HTML of an email template. I have tried using the Acumatica AI, but still no luck. This template goes out when a Shipment is Confirmed, and I have a table for the Tracking Numbers.

I would like the statement to say, IF ((SOPackageDetail_trackNumber)) has a value, display the table, IF it does not have a value, do not display the table.

 

<p class="MsoNormal" style="line-height: normal;"><font face="Arial, sans-serif">Dear Customer,<br><br>This is an automatic email to notify you that Order # <span data-field="yes">((SOOrderShipment_orderNbr))</span> has been shipped with Shipment # <span data-field="yes">((SOShipment_shipmentNbr))</span>. You can find a copy of the shipment confirmation attached to this email.nbsp;<br><br></font></p><p class="MsoNormal" style="line-height: normal;"></p><p class="MsoNormal" style="line-height: normal;"><br></p>


<table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" style="background: rgb(255, 255, 255); width: 100%;">
<tbody>
<tr>
<td style="direction: ltr; font-size: 0px; text-align: left; vertical-align: top;">
<table role="presentation" cellspacing="0" cellpadding="0" border="0">
<tbody><tr><td class="" style="vertical-align: top; width: 1000px;">
<div class="mj-column-per-100 outlook-group-fix" style="font-size: 13px; text-align: left; direction: ltr; display: inline-block; vertical-align: top; width: 45%;">
<table role="presentation" width="40%" cellspacing="0" cellpadding="0" border="0" style="vertical-align: top;">
<tbody><tr><td align="left" style="font-size: 0px; word-break: break-word;">
<div style="font-family: sans-serif; font-size: 14px; line-height: 23px; text-align: left; color: rgb(0, 0, 0);">
<table width="70%" cellspacing="0" cellpadding="0" style="min-width: 100%;">
<tbody><tr>
<td>
<table class="smarttable" width="100%" cellspacing="0" cellpadding="0" style="min-width: 100%;"><thead>
<tr>
<th scope="col" width="40%" style="font-family: Arial, sans-serif; font-size: 14px; border: 1px solid rgb(237, 237, 237); border-collapse: collapse; line-height: 15px; color: rgb(0, 0, 0); text-align: left; background-color: rgb(237, 237, 237);">Tracking Number(s)<br></th>
</tr>
</thead>
</table>
<table width="100%" cellspacing="0" cellpadding="0" style="min-width: 100%;"><tbody><tr>
<td><foreach&gt;
<table class="smarttable" width="100%" cellspacing="0" cellpadding="0" style="min-width: 100%;"><tbody>
<tr>
<td data-label="Tracking Number(s)" width="40%" valign="top" style="font-family: Arial, sans-serif; border: 1px solid rgb(237, 237, 237); border-collapse: collapse; font-size: 12px; line-height: 20px; text-align: left;">((SOPackageDetail_trackNumber))<br></td>

</tr></tbody></table>&lt;/foreach&gt;</td></tr></tbody></table>
</td></tr></tbody></table>

</div>
</td></tr></tbody></table>
</div>
</td></tr></tbody></table>
</td></tr></tbody></table>

<br>

<span style="font-family: Arial, sans-serif;"><br></span><span style="font-family: Arial, sans-serif;"><br></span><p class="MsoNormal" style="line-height: normal;"><span style="font-family: Arial, sans-serif;">If you have any questions, please don’t hesitate to reply to this email.</span></p><p class="richp"><br>Thank you for choosing The company</p>

Thank you!

 

 

 

Best answer by rkenna

Just an update on this- this is not possible in HTML to have these statements with Acumatica. The solution workaround I found is to create 2 separate business events, and 2 separate email templates. If there are tracking numbers, then use the email template with the table. If there are not tracking numbers, use the template without the table. 

 

-RJ

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img
  • Author
  • Semi-Pro I
  • 30 replies
  • Answer
  • January 14, 2025

Just an update on this- this is not possible in HTML to have these statements with Acumatica. The solution workaround I found is to create 2 separate business events, and 2 separate email templates. If there are tracking numbers, then use the email template with the table. If there are not tracking numbers, use the template without the table. 

 

-RJ


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2754 replies
  • January 14, 2025

Thank you for sharing your solution with the community ​@rkenna!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings