Uses glue::glue() to evaluate expressions enclosed in brackets as R code.

text(
  msg,
  content,
  disposition = "inline",
  charset = "utf-8",
  encoding = "7bit",
  interpolate = TRUE,
  .open = "{{",
  .close = "}}",
  .envir = NULL
)

Arguments

msg

A message object.

content

A string of message content.

disposition

How content is presented (Content-Disposition).

charset

How content is encoded.

encoding

How content is transformed to ASCII (Content-Transfer-Encoding).

interpolate

Whether or not to interpolate into input using glue.

.open

The opening delimiter.

.close

The closing delimiter.

.envir

Environment used for glue interpolation. Defaults to parent.frame().

Value

A message object.

See also

Examples

library(magrittr) msg <- envelope() %>% text("Hello!") # Using {glue} interpolation. # name <- "Alice" msg <- envelope() %>% text("Hello {name}.") print(msg, details = TRUE)
#> Date: Tue, 28 Sep 2021 06:51:24 GMT #> X-Mailer: {emayili}-0.5.6 #> MIME-Version: 1.0 #> Content-Type: text/plain; charset=utf-8 #> Content-Disposition: inline #> Content-Transfer-Encoding: 7bit #> #> Hello {name}.
# Disable {glue} interpolation. # msg <- envelope() %>% text("This is a set: {1, 2, 3}.", interpolate = FALSE)