I need to pass two images in a html template to send in email.
What is the best way VB or Create html content?
I tried using using html content activity but stuck in how to add the src id as variable & how to pass that variable ?
you can use src tag in your body of the email content. Also please make sure to check isbody html.
you can refer the below thread.
hope it helps!!!
Create html content is preferred. You will have to convert the Image to Base64 string and then pass to html.
UiPath Studio provides html editor for it also. More easy to draft emails.
Refer this thread.
Thanks,
Ashok
Here is a 2 step way to add images
- Select Insert Image
- Select From file when run Option and Provide a Variable which contains the filePath
cheers
HI @Ana_Patricia ,
Try the below steps to convert the image to base64 and then add in your html code.
Step 1 : You can convert the image in to base64 string by using the below syntax
strDecodedImage =Convert.ToBase64String(System.IO.File.ReadAllBytes(“yourfilename.png”))
Step2: for example if your image is in data folder , use the below syntax
StrDecodedBase64 = “data:image/png;base64,”+StrDecodedImage
Step 3: Use your html code as per your requirement, I am giving an example html code to add src tag in the html code
strHTML = “
Thanks,
RPA Team
Attaching the above code screenshot for better understanding.
Hope this information helps…