2

I've been using Ruby on Rails at work for years. My job changed. PHP server inherited. Have extended it to include Laravel. Have just started learning Laravel.

What I need to get done, right now, is I need to start sending automated scheduled emails, with graph images embedded in the email HTML body. I've been doing a lot of searches and this seems like the path to follow for sending automated emails (without being able to spend money on something like FusionCharts for this):

  1. Use Google Charts Printing PNG Charts to save graphs as PNG images on the server
  2. Use Pears Mail_Mime::addHTMLImage() function to embed the saved graph pngs into (I've never used Pear before).
  3. Delete images files after email is sent

What I'm looking for is some advice on exactly what path I should follow. What I'd really love to find is some complete sample code that's a working example of saving a chart (google or other) as an image file and then embedding that file into an email HTML body.

Thanks for any help. Since I'm just barely starting to learn Laravel, I'm not sure if Laravel has anything that would make this easier than plain PHP.

Reno
  • 2,962
  • 9
  • 41
  • 68
  • 1
    https://stackoverflow.com/questions/42503168/laravel-5-4-embed-image-in-mail try this maybe? – Shobi Dec 13 '18 at 06:28
  • 1
    You can use cron job for automated codes. It exists in cpanel. And in your case use plain php that your code not seems big enough and I think it would be good write cron job in plain php not in laravel – Ozal Zarbaliyev Dec 13 '18 at 08:12
  • Thanks for the advice. In anything I've ever tried to learn over years in web programming, emailing graphs always feels like the least documented and hardest thing to find information on... I'm inside a very big corporation and there is always a high demand for getting things like a daily or weekly graph sent automatically via email. Always seems odd to me this subject seems like a rarely spoken of step child of web programming. – Reno Dec 13 '18 at 14:28

0 Answers0