Adding List item into email body


Badge +9

Hi guys,

I have posted the similar question in my previous posting but didnot get any solution yet. Let me try once again if any export can help me to figure out how to do this.

All I am doing is showing list items records from the smartobject into email body. It could be nice if list items can be shown in a grid view format.

 

Thanks.


3 replies

Userlevel 1
Badge +4

We solved this using a suggestion for a K2 consultant.

We use a single Smart Object call to return a block of HTML to into the email and that HTML contains a table with all the rows and data we need.

In our case we used a .Net assembly to create the HTML then used the Assembly Broker to turn that into a Smart Object.  The method to build this takes in all the parameters to query for the data directly and then returns the HTML as a string.

 

I'm sure you could do the same thing using a stored proceedure, but lengthly string manipulation is not recommended in SQL Server or Oracle unless done in code.

 

There are also a couple other forum posts about this:

 

http://community.k2.com/t5/K2-blackpearl/Notification-Email/m-p/45375#M10528

http://community.k2.com/t5/K2-blackpearl/Email-Notification-with-list-of-data-on-email-body/td-p/77730

 

 

Nathan

Badge +9

Thank you Guys. I still do not have a clear understanding of how to handle this.

 

All I did is created a XML field in the context browser and mapped with the editable list item table to save values into the XML field (shown below)

 

<XmlDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><XmlNode><Account>17200 - Fixed Assets - Restaurant Equipment</Account><ItemDescription></ItemDescription><Amount>10</Amount></XmlNode><XmlNode><Account>13300 - Prepaid - Workers' Comp Insurance</Account><ItemDescription></ItemDescription><Amount>50</Amount></XmlNode></XmlDocument>

 

Now, while configuring the email body , I could able to retrieve only the first node values. How do I retrieve all the node values in the HTML format.

Thanks

Badge +9

This issue has been resolved with suggestion and sample code I received from Nathan. THank you so much Nathan for all your support and help.

I created .Net endpoint service broker, register its service assembly and created a smartobject to return a single string value of HTML and use that string in the message body. All codes and formatting are done in the class library.

Reply