Solved

Email body with image

  • 7 January 2022
  • 2 replies
  • 40 views

Userlevel 3
Badge +9

Hi,

 

I want to dynamically add images to the email body which will be sent bij dbmail.
Because of more departments en several marks the logo’s added to the email body need to be added dynamically base on user en department.
If now added a table with a link to the path, that works fine in the application but when sending it out the logo’s are empty, because of the pointer to the local path.
For one html table cell for example <td><img src="G:\Thinkwise\logo1.png” 

I have stored the images in the database as well on department level, let’s say the field [department].logo
I’ve created an email-template with the tekst [handtekening] 
When creating the email I replace the [handtekening] tekst with the complete email signature of the user.

When I put the logo directly in my email template, the logo is embedded in the template and that works, but that is not dynamic.
 

So the challenge is to add the code of the image stored in the [department].logo field (or the code of the image stored on the location “g:\thinkiwsie\logo1.png” into the body field of the email to be sent out.
I store each ‘to-be-sent’ in a email_send_list table and table has a field body (html type)

I hope anyone of you can give me a clue…. 

 

icon

Best answer by Edwin Saan 19 January 2022, 14:49

View original

2 replies

Userlevel 5
Badge +10

 If the images are stored in the database you could use base64 as the image source. 

Please check this post where Jasper shared an example:

 

 

Userlevel 3
Badge +9

Hi Erwin, thans. I already found out that I had to convert the images to base64 code. I thought I had posted my own solution but apparently that has failed. I decoded the images with an internet tool to a base64 code and with that code I can dynamically add the images to the body. Case closed

Reply