List Data in the Body of an Email

Hi -
Is there a way to list the data set within the body of the email in a grid format?

As an example the project returns a list of information, rather than pushing to a flat file and attaching, can I embedd this into the email?

State Target
OH 1
IN 2
MI 3

Hi @adambeltz,

you can dynamically generate a HTML table and insert it into the email message body.

In the example below, a sample dataset is converted into HTML table, and then passed to a subproject as a parameter. The parameter is inserted into the email message body. Notice that the email format is HTML, not plain text.

HTML table.morph

send email.morph
image

HTML table.morph (4.5 KB)
send email.morph (1.5 KB)

To make the example work you will need to configure the embedded email connector in send email.morph.

1 Like

Thank you. I think you just solved the age old “word merge” problem. You should definitely highlight this as a feature.

https://support.microsoft.com/en-us/help/294686/how-to-use-mail-merge-to-create-a-list-sorted-by-category-in-word

Hi Adam,

now sending emails with an HTML table is dead easy. Check out this topic: How to send email with KPI metrics as HTML table

Hi, how do I add multiple HTML tables into one email? Also, my headers are not pulling through as expected.

Hi Erhica and welcome to the Community!

You can use the same technique described in the post marked as the answer but for multiple tables.

Note that in version 5.3 we will be adding an action for generating HTML snippets and whole documents from a text template.

Hi, thanks but the problem is, it sends multiple emails with only one table in each email. Attached is a screenshot (I did not run the db connections for data privacy) however you can see I copied the example answer. How do I combine the two HTML tables into one email as the email only takes a parameter name called {HTML Table} which is the name that both tables have as a parameter.


image

Hello @Erhica ,

You will have to create two parameters in the email module, for example “HTML Table 1” and “HTML Table 2”. In the parent module, you generate each HTML table individually, but you only need 1 “Iterate” action, which includes both HTML tables. You could use the “Append” action to put one HTML table next to the other right before iterating and sending them over to the email module. For example:

Parent module:

Email module:

Regards!

Thanks @roberto I follow the logic, but iterate does not allow me to add more than one parameter as can be seen by the greyed out “Assign more parameters” even though I appended as instructed.

Hello @Erhica,

You need to create a second parameter in the Email module called “HTML2” first. Once you create the parameter in that module, you will be able to assign the value of that column to that new parameter.