Dynamic gmail body

Hi, Team!

How can I put the range from excel file into a gmail body and send the email?
The range will be every time different.

Thank you,

image

Use Read Range to read the sheet into a datatable. Then loop through the datatable to generate HTML (stored in a variable). Then use that variable in your Send SMTP Email activity’s Body.

1 Like

Thanks for the idea!
I created my html variable called HtmlText, but I don’t know how to write this variable in the body of the mail in the Send SMTP Mail activity …
Can you help me?

Hi @LZlz

you can add this custom package to your project, which takes input as data table and provides HTML format string as output.

DataTable.to.HTML.String.1.0.2.nupkg (23.8 KB)

Note: please check IsBodyHTML in send mail properties

1 Like

Hi @lzia ,

You can also watch below video to send table in mail body in gmail.

1 Like

Hi @LZlz

I didn’t try this but you can give a shot at it.

convert the data table into a string using Output data table activity and pass this variable to the mail body

keep us posted if this worked

1 Like

That’ll create a CSV. You could conceivably then do Replaces to convert it to HTML.

Hello everyone!

I did it this way: I created an html variable called HtmlText and in the body of the email I wrote it as below and it worked.
I checked also IsBodyHtml.

When I received the email, looks like:

And I want to appear on the separate lines…like:
image

But I don’t know to do that…
Do you have any suggestions for me?

add tag “
” for a new line as it is a HTML tag
“this is a message sent automatically
good morning!”

image

1 Like

Perfect!
That’s what I needed!

Thank you so much! :slightly_smiling_face: :+1:

1 Like

Look into below post to convert DataTable variable into HTML table.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.