How to send DocumentList in the form of table to an email

Hi,

I’m using webMethods 10.5 version and I’m trying to send document list values in the form of table using pub.client:smtp service. The value of the input parameter ‘body’ of the service pub.client:smtp is as below.

INPUT:

%LOOP docList%

ABC DEF
%value value1% %value value2%
%ENDLOOP%

Note: I have unchecked the checkbox - perform pipeline variable substitution.

Output:
The email is getting generated with the email body as it is , and the code didn’t get executed as expected.

I have seen many posts on this, but no solution is provided. I’m facing the same problem as mentioned in the following post.

Please provide me your valuable suggestions on this.

Regards,
Sasikala Manyam.

I did build a similar requirement, but I’m struggling to see your picture in my head since you say -

Do you mean variables aren’t substituted or the flow step(s) didn’t execute?
Can you post a screenshot of the flow steps and the actual email so I can help you better?

KM

Hi,
Yes, the values didn’t get substituted.

The email appears like this.

Update - I just noticed this comment, but this must be selected to substitute the variables with actual data, or did I forget DSPs (been years, I concede)?

Can you check and ensure that your pipeline variables (docList, value1 and value2) are present (and available) for this substitution?
You can add a log invocation just before this step, to check.

Having said that, I can’t recall if the Tag Directives are case sensitive; see this page for version 10.11 (link).

KM

Hi,
I tried the debugLog, I could see the values getting logged in the server logs. But, the email body is not framed , it is still showing the dsp code in the email body. Do I need to do any extra settings for the dsp code to get executed?

Regards,
Sasikala Manyam.

You cannot use the DSP syntax in this way, you need to use the following service

pub.report:runStringTemplateOnPipe

“setting values” using variables substitution only works for simple values such as %doclist[0]/value1%

If you want to use DSP templates you have to use one of the pub.report:* services.

Good luck.
John.

1 Like

I used DSPs over a decado ago and it showed in my responses.
Thanks @John_Carter4.

KM

Hi John,
Thanks for your reply. I tried to use the service ‘pub.report:runStringTemplateOnPipe’ service, and the input provided is the ‘simpleTemplate.template’ which is placed under ‘Integration Server_directory\packages\packageName \templates’.
After executing the flow step, where the ‘pub.report:runStringTemplateOnPipe’ service is called, the output I see is the template name, $txt value is returned as ‘simpleTemplate.template’. Does that mean, the input is wrong? is my template not getting invoked?

Please advise.

Regards,
Sasikala Manyam.

Hi there,
You don’t need to create a file template for runStringTemplateOnPipe, it’s the simplest one. You can just enter your text directly into input $template.

I have attached a screenshot for clarity, I just coded this in 30 secs and it works :wink:

@Venkata_Kasi_Viswanath_Mugada1, I’m actually a big angular/react developer fan. However, I also love DSP because you can use them very easily to format verbose file formats that are mostly static or even create a simple dashboard for admin purposes, and it only take 15 minutes to develop and is super light-weight. few kb’s at most.
John.

Agreed @John_Carter4, good times - I recall using the IS Admin DSPs to learn :slight_smile:
It’s good to see that we continue to support DSPs.

KM

Hi John,
Thank you! I could able to loop over the list and see the values. But, I want to sent them to the mail in the form of tabular column. When I’m enclosing them in

%loop doclist1% %endloop%
ABC %value ABC%

the html tags are not getting replaced, I’m not able to see the content in the form of table. How can I achieve this?

Are you showing me what you want here ?

  1. You need to show me want you want as example,
  2. Show what you are actually getting.
  3. Finally your current template.
    thanks
    John.

Hi John,

  1. What I want to achieve is below.
  2. What I’m getting is this.
  3. My template is as below.

Please suggest.

Regards,
Sasikala Manyam.

Please use the below code, it should work. Thanks -- Arul ChristhuRaj. 


<html>
<body>

<h1>List of Services and Its current state</h1>
<p>Hi, <br>Below are the details of the services</p>

<table align="center" border="1" width="90%" style="font-family:calibri;font-size:13px;">

<tr>
<td>Service</td>
<td>State</td>
</tr>

%loop docList1%
<tr>
<td>%value service%</td>
<td>%value execState%</td>
</tr>
%endloop%
</table>

<p>Regards,<br>Team ABC</p>

</body>
</html>

Thank you @arulchristhuraj_alphonse1, you beat me to it.
regards
John.

Hi John and Arul,

I have used the above pasted code in the template and I got the below in the email content. The loop got executed, but the table structure is not getting populated.

Can you upload your package here, so I/we can investigate and test?

KM

I’m afraid, I can’t do it. It has some details of the project.

You have to set the content type as text/html and map your HTML content to the attachments of the SMTP service.

1 Like