0

Hi i have a requirement to send a daily email to customers with latest information. This weather information is on an image on the message body. The readings on the image will be dynamic. Any pointers on how i can achieve this.

Same image is below enter image description here

As seen above all the text will change dynamically based on the weather forecast and this has to go as a mail body.

I use java for programming, but i am ok to use any programming language based on suggestion on how this can be archived quickly

onlinejava
  • 163
  • 1
  • 4
  • 14
  • Can't you include the image as a link to your website, and you just have to update the image at that URL every x amount of time... – Giacomo Alzetta Aug 13 '18 at 15:09
  • 1
    Is your question how to send script via email so it is executed in the user's email program? If so - it is not possible. You could however include an image url with some user id in it and gnerate the image on your server when the users email programm downloads the link. – Sebastian Aug 13 '18 at 15:10
  • Yes my point is to create an image on the server an show it in the body of the HTML message. But how do i create an image on the server, how to i alter the contents of an image the text in it. any pointers – onlinejava Aug 13 '18 at 15:15
  • You will be able to do this with PHP. Get location thru device or pass thru data, display an image based off location of device or from data file. If you give that a go and have issues ask a new question. – Syfer Aug 13 '18 at 23:11

1 Answers1

1

You can create inline images within HTML like this: https://en.wikipedia.org/wiki/Data_URI_scheme .

A little more effort is required to create MIME attachments, which you would reference from your HTML. This also results in inline images. How to create an email with embedded images that is compatible with the most mail clients

These are two alternatives for creating a dynamic image at the time of your email's creation. For more dynamic behaviour, you would either use proper image urls (which will be blocked by clients) or you could use Javascript (which should not work for any client for security reasons).

Mick
  • 954
  • 7
  • 17
  • How do i alter the contents of the image on a daily basis, to update the text like the temperature etc.. – onlinejava Aug 13 '18 at 15:17
  • You better create a second question: "how to create an image." ;) Have you considered to "just" create a colorful HTML e-mail? You could include your little cloud icons with the mentioned inline techniques - and you would be ready for development. – Mick Aug 13 '18 at 15:27
  • btw: you would also need to inline your font. – Mick Aug 13 '18 at 15:28