Источник:
https://ax.docentric.com/improved-em.../#comment-2123
==============
In reply to
VardhaRaj.Hi,Before creating and sending an email message, you can check if there is no data (lines) used for populating the dynamic table in the email template, so in that case you can use a different email template without the dynamic table.Alternatively, you can create a pre-event handler for the
DocEmailTemplateManager::generateEmailBodyAndSubjectWithDynamicLines() method and pre-process the email body with placeholders as a string containing HTML to remove the empty HTML table. This code could look like this:
const str repeatingBlockMarkStart = '<!‐‐%HIDDEN_TABLEBEGIN%‐‐>';const str repeatingBlockMarkEnd = '<!‐‐%HIDDEN_TABLEEND%‐‐>';
int posBegin = strScan(_emailBodyWithPlaceholders, repeatingBlockMarkStart, 1,
strLen(_emailBodyWithPlaceholders));int posEnd = strScan(_emailBodyWithPlaceholders, repeatingBlockMarkEnd, 1,
strLen(_emailBodyWithPlaceholders)) + strLen(repeatingBlockMarkEnd);
if ((posEnd - posBegin) > strLen(repeatingBlockMarkStart) + strLen(repeatingBlockMarkEnd)){ emailBody_FirstPart = subStr(_emailBodyWithPlaceholders, 1, posBegin - 1); emailBody_LastPart = subStr(_emailBodyWithPlaceholders, posEnd,
strLen(_emailBodyWithPlaceholders)); newEmailBody = emailBody_FirstPart + '<BR>' + emailBody_LastPart;}
Hope that this helps.Kind regards,Ana
Источник:
https://ax.docentric.com/improved-em.../#comment-2123