html - Use actionButton to send email in RShiny -


i'm working on web app in shiny. i'm pretty familiar r knowledge of html, css, jquery, etc lacking makes formatting things nicely challenging.

i want include actionbutton user can click on send email administrator in case of questions or concerns. here's have far, kind of works pretty heinous:

library(shiny) ui <- shinyui(fluidpage(   # set layout/format app   sidebarlayout(     sidebarpanel(       downloadbutton("download_data", "download data"),       br(),       actionbutton(inputid = "email1",                     icon = icon("envelope", lib = "font-awesome"),                     a("contact admin",                         href="mailto:my_awesome_email_address.com"))     ),     mainpanel(),     position = "left"   ) ) )  server <- shinyserver(function(input, output) {}) shinyapp(ui, server) 

if possible, i'd keep using actionbutton or similar in order keep same button format across both buttons.

thanks in advance!

okay, annoying. hate 1 of people answers own question, here goes:

i toyed around ordering of different tags in code , realized current code wrong because stating wanted text of button link email address , not button itself. fix this, flipped nesting of actionbutton , a() tag following:

a(actionbutton(inputid = "email1", label = "contact admin",                   icon = icon("envelope", lib = "font-awesome")),     href="mailto:my_awesome_email_address.com") 

clicking anywhere on button automatically opens email addressed given email address after mailto argument. no html or css coding required. hope helps else can spend time doing more valuable scouring internet hours on end.


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -