Dynamic name in email body with email message in html

Hi,
I want to achieve a task of email, below is my issue

I have an excel with column name “Name” and “Email id” and i have to send email with email body having name from the excel with my message in html format like below

Dear +record.Item(“Name”).ToString,





On this special day, We wishes you very Happy Birthday! May you be showered with blessings and happiness!!!


With warm wishes,


Team

I have created a flow attaching with this.

I want the recipient to receive below email in e-mail body
test.html (293 Bytes)

1 Like
  1. Create a template file with the following text:
    Dear {0},

On this special day, We wishes you very Happy Birthday! May you be showered with blessings and happiness!!!

With warm wishes,

Team

Please format the HTML text as per your requirement. I think this is what you do in message.txt.

  1. Read this file and then use String.Format(the variable that holds this text , record.Item(“Name”).ToString)

This line will replace the {0} in the html with the Name.

Ensure you select IsBodyHTML in the Send Outlook Mail message property.

Can you please check is it okay?

  1. In the Message.txt, please add the first line as :

Dear {0},

  1. image
    image

  2. image
    String.Format(messageContent,)

  3. image
    image

i didn’t get this part?? String.Format(the variable that holds this text , record.Item(“Name”).ToString)???

In the message.txt Dear {0}, when you use the String.Format(Message, record.Item(“Name”).ToString)) will replace the {0} in the message with the String Name.
Here is a simple example.

image
The Assign activity here
messageContent = String.Format(messageContent,“Indrajit Shah”)
Output:
image

Hope this is clear.

1 Like

thanks @SowmyaLeo

One more thing the image with the email is now showing, is there anything can be done??

Kindly follow this thread for Embedding image using Outlook

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