Adding an Email button in Shiny, using TableTools or otherwise

女生的网名这么多〃 提交于 2019-12-02 02:41:31

A quick way is to use mailto(which works well with Outlook).

The mailto would need to be inside an HTML() tag for shiny to render it.

HTML(
<a href="mailto:hello@rshiny.com?
body='Hello,World!  Check out my data.'
&subject='Data'
&attachment='\\myfolder\shinyData.csv'">click here for email!</a>
)

There are two hypothetical ways to do this.

  1. Have the mailto in ui.R

The code would need to download the datatable at the user's end (probably in the temp folder), and attach it there.

  1. Have the mailto in server.R

You'll need the csv file already saved on your server in order to load it as an attachment. You would need to use the above code inside a renderUI() and also pass the file from your server to the user's end.

There is a downloadHandler() function which allows users to download from the server which could be of use for the above.

I've never tried passing attachments around as you are trying, however the above logic should both allow you to create an email, and get you on the right path to attaching files.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!