html {emayili} | R Documentation |
Add an HTML body to a message object.
Description
Add an HTML body to a message object.
Usage
html(
msg,
content,
disposition = "inline",
charset = "utf-8",
encoding = NA,
css_files = c(),
language = FALSE,
interpolate = TRUE,
.open = "{{",
.close = "}}",
.envir = NULL
)
Arguments
msg |
A message object. |
content |
A string of message content. |
disposition |
Should the content be displayed inline or as an
attachment? Valid options are |
charset |
What character set is used. Most often either |
encoding |
How content is transformed to ASCII. Options are
|
css_files |
Extra CSS files. |
language |
Language of content. If |
interpolate |
Whether or not to interpolate into input using glue. |
.open |
The opening delimiter. |
.close |
The closing delimiter. |
.envir |
Environment used for |
Value
A message object.
See Also
Examples
# Inline HTML message.
envelope() %>% html("<b>Hello!</b>")
# Read HTML message from a file.
htmlfile <- tempfile(fileext = ".html")
cat("<p>Hello!</p>\n", file = htmlfile)
envelope() %>% html(htmlfile)
# You can pass a vector of character. Components will be separated by a
# "\n".
envelope() %>% html(c("<b>Hello</b>", "<p>World!</p>"))
# You can also pass a tagList from {htmltools}.
if (requireNamespace("htmltools", quietly = TRUE)) {
library(htmltools)
envelope() %>% html(tagList(h2("Hello"), p("World!")))
}