Iterating over an DocumentList in an text field (for an e-mail html message)

Hi everyone.

I have a service whitch is returning a DocumentList called revisions. The second service is for sending an email, with an manually hardcoded message.

The email template looks like this:

<body>
<html>

<p>New code is ready for ticket %ticketUID%.</p>

<p>
List of changes: <br>
<br>
Revision number: %revisions/number%<br>
<br>
Revision comment: %revisions/comment%
</p>
</body>
</html>
%ticketUID%

is working perfecly, showing the ticket number in the received email:

New code is ready for ticket A-17.
List of changes: 

Revision number: %revisions/number%

Revision comment: %revisions/comment% 

But, cause revisions is a DocumentList, I’d have to iterate over it somehow, but I have no idea how… Could anyone give me some hints how to do it?

Hi Zbigniew,

please have a look at the DSP_and_Output_Template_Developers_Guide for your wM version.

Most likely you are looking for something called foreach or loop.

Regards,
Holger

Hi Holger,

Vielen Dank für deine Antwort :wink:

I tried to use the DSP tags… still no progress… the message body looks now like this:

<body>
<html>

<p>New code is ready for ticket %ticketUID%.</p>

%ifvar revisions%
 %loop revisions%  
 <p>Number: %value number% Comment: %value comment%</p>  
 %endloop%
%endifvar%
</body>
</html>

But the output HTML mail message looks like this:

New code is ready for ticket A-17.
%ifvar revisions% %loop revisions% 
Number: %value number% Comment: %value comment%
%endloop% %endifvar% 

So the tags seem not to be interpreted…

Hi,

Shouldn’t you still use the previous string

“Number: %value revisions/number% Comment: %value revisions/comment%”

as revisions is a document when inside the %loop revisions% construct?

Best Regards,