Skip to main content

hello together,


I like to create an email with the data from a smartbox.


For example three travel destination stored in the smart box with the travel number 88.


# start of the mail


Hello here is the list:


 


USA       14           2000 km


China    20           6000 km


Spain     10           700


# End of the mail



I have a data in a smart box. (fields: number, destination, days, distance)


I have a smart object for this data with a method “get list”.


This method works well in the infopath form. (filling a reapeating table)


 


 


I don’t know if I started in the right way:


In the process, I have realized an action called “mail” with two events.


First with the event wizard “smart object event”  - I think: here I can prepare the output-list with three entries from the travel number 88.


Second with the event wizard “mail event” – I think: here I can use the result (a list with the three entries) from the first event wizard.


thanks


robert

There's no shortcut way to do this as far as I know. I usually create a place holder in the email body, something that won't normally occur, i.e.


Dear User,


The following items have been submitted:


{[ItemsTable]}


Regards,


K2


 


In the code behind for the email, I will then get the list of items and build the HTML table, and finally do a replace in the email body just before sending it out.


this.EmailMessage.Body = K2.Configuration.Body.Replace("{{ItemsTable]}", yourHTMLString);


 


Full example by Eric Eichler here:


http://www.k2underground.com/forums/t/10702.aspx


 


If you can use XML however, you may want to have a look at the following:


http://www.k2underground.com/blogs/johnny/archive/2011/05/28/inline-functions-to-convert-infopath-repeating-node-element-to-html-table-bullet-numbered-list-or-csv-list.aspx


Reply