Add or query subject of message.

subject(
  msg,
  subject = NULL,
  interpolate = TRUE,
  .open = "{{",
  .close = "}}",
  .envir = NULL
)

Arguments

msg

A message object.

subject

A subject for the message.

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 or the subject of the message object (if subject is NULL).

See also

to, from, cc, bcc and reply

Examples

library(magrittr) # Create a message and set the subject msg <- envelope() %>% subject("Updated report") # Retrieve the subject for a message subject(msg)
#> Updated report