Home Forums Development Support for collection values in Email Notification Template

Viewing 3 reply threads
  • Author
    Posts
    • #11602
      Aditya PhatakAditya Phatak
      Participant

      Hi,

      We have a data model in our ServiceRequest class such that against 1 SR there could be multiple Beneficiary Details (stored in a different class TxnBeneficiaryDetails) represented by a new attribute txnBeneficiaryDetails on ServiceRequest class (collection = true).

      In email notification template, we want to send out details of this Beneficiary Details grid and would like to know whether it is supported.

      In essence, is it possible to use “for-each” to loop through the beneficiaryDetails collection and gather values of attributes?

      Our email template configured looks like below:

      <Table border=1 bordercolor=black>
      <tr>
      <td bgcolor=#042351 align=center>
      <b><font color=white size=5>Service Request: ${requestIdentifier} has been referred to you for approval.</b></font>
      </td>
      </tr>
      <tr>
      <td width=30%><b>Customer Name</b></td>
      <td width=5%>:</td>
      <td>${primaryEntity fullNameDetail}</td>
      </tr>
      <tr>
      <td width=30%><b>Due By</b></td>
      <td width=5%>:</td>
      <td>${dueTimeStr}</td>
      </tr>

      <!– BENEFICIARY DETAILS –>

      </Table>

      0
    • #11611

      Hi Aditya,

      Since it’s a new attribute, the email notification template model will have to be customized to expose that specific attribute.

      Recommendation would be to write specific log for your object.

      However, please keep in mind the email notification (using rules engine for approvals as well) is designed for the Users of the system. Collection of Users, UserGroup is supported out of the box.

      Hope that will help with the design.

      Regards,

      Dhruv

      0
    • #11628
      Aditya PhatakAditya Phatak
      Participant

      Hi Dhruv,

      That is not exactly what I was looking for. The new attribute is a collection and I want to use values within that collection inside the email body of the notification using a loop (like for-each). Please take a look at the html code I’ve given where I want to include the collection values.

      Is it feasible to do so?

      0
    • #11638

      Hi Aditya,

      My apologies, I got confused with the Approval tag in the HTML.

      I believe  the email template code does not allow to loop through a collection.

      To achieve the desired behavior, I would recommend a new summaryString attribute which will have the appended list of txnBeneficiaryDetails in the format you would like.

      Then that summaryString attribute can be used a simple token in association to the Service Request object.

      Hope that helps.

      Regards,

      Dhruv

      0
Viewing 3 reply threads
  • You must be logged in to reply to this topic.