Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe your template is not suited for what you try to achieve. I assume that your template containse the header info (Name and Date) and one entry for a tender. When you read the whole template each time you repeat the name and date as well as the tender entries.</p> <p>What you need to do is to have one template for header info (Name and Date) and one template for the tender records. Something like this pseudo-code:</p> <pre><code>var TemplatePath = userDetail.UserTypeTemplate.EmailTemplatePath; var headerTemplate = userDetail.UserTypeTemplate.EmailHeaderTemplatePath; toEmail = userDetail.Email; fromEmail = ConfigurationManager.AppSettings["AdminMail"]; var sbMail = new StringBuilder(); using (var sReader = new StreamReader(headerTemplate)) { sbMail.Append(sReader.ReadToEnd()); sbMail.Replace("{Name}", userDetail.Name); sbMail.Replace("{CurrentDate}", currentDateTime.ToString("d")); } foreach (var tender in userTenders) { using (var sReader = new StreamReader(TemplatePath)) { sbMail.Append(sReader.ReadToEnd()); sbMail.Replace("{TenderTitle}", tender.TenderTitle); sbMail.Replace("{TenderID}", tender.TenderID.ToString()); sbMail.Replace("{TenderType}", tender.TenderTypeName); sbMail.Replace("{TenderValue}", tender.TenderValue.ToString("₹ 0,0", InCulture)); sbMail.Replace("{TenderEMD}", tender.TenderEMD); sbMail.Replace("{Location}", tender.Location); sbMail.Replace("{OrgName}", tender.OrgName); sbMail.Replace("{LastDateForSubmission}", tender.LastDateForSubmission.ToString("d")); sbMail.Replace("{SubProductCatName}", tender.SubProductCatName); sbMail.Append("&lt;br /&gt;"); } } </code></pre> <p>This should allow you to make one header record and as many tender records as you need.. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload