本文介绍了通过电子邮件发送维加图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过任何方式从服务器端通过电子邮件发送vega图表吗?从Spring Boot应用程式说起?我将vega规范保存在db中,我也可以从服务器端填充数据,我想知道如何使用它发送带有图表的电子邮件.

Is there any way I can send vega chart in email from server side? Say from a spring boot app? I have the vega spec saved in db and I can fill up data as well from the server side, was wondering how I can use this to send out an email with the chart.

Vega嵌入将不起作用,因为大多数电子邮件客户端都从正文中过滤出脚本标签.

Vega embed won’t work as most of the email clients filter out script tags from body.

我也尝试过vega-cli,但是由于它基于nodejs库,所以我无法将其与Spring Boot集成.

I tried vega-cli too but since it’s based on nodejs libs I could not integrate it with my spring boot.

感谢任何帮助,可以在此处找到解决方案.

Appreciate any help find a solution here.

推荐答案

正如关于松弛的讨论,我认为对于电子邮件,最好的解决方案是创建一个位图(例如PNG)并包含它,因为您无法真正运行电子邮件客户端上的JS.

As discussed on slack, I think for email, the best solution is to create a bitmap (e.g., PNG) and include it since you can't really run JS on email clients.

您也可以选择提供指向托管页面的链接(特别是如果您的图表是交互式的,因为PNG显然不会交互式).

You can optionally provide a link to a hosted page too (esp. if your chart is interactive since the PNGs won’t be interactive obviously).

这篇关于通过电子邮件发送维加图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-15 04:11