attach_connect_email: Associate an email when publishing an R Markdown document to...

View source: R/connect_email.R

attach_connect_emailR Documentation

Associate an email when publishing an R Markdown document to RStudio Connect


This function is used to customize emails sent by RStudio Connect in conjunction with publishing an R Markdown document. It associates a custom email message with the main R Markdown document, which Connect can send to selected recipients. The main input is a rendered email message, which can be produced by either the render_email() or render_connect_email() function.


  email = NULL,
  subject = NULL,
  attachments = NULL,
  attach_output = FALSE,
  text = NULL,
  preview = TRUE



A rendered email message. Normally, we'd want to use an associated .Rmd file with the blastula::blastula_email R Markdown output format in render_connect_email() call (where its input is the email .Rmd file).


An option to specify the the email subject while attaching the email object.


A vector of attachments for the Connect email. These files can be any of those deployed when publishing to RStudio Connect, and, any generated files (via R Markdown rendering).


Should the rendered output of the main R Markdown document be included as an email attachment? By default, this is FALSE. If TRUE the main R Markdown document will be attached first (before any files specified in attachments) and the filename will be preserved.


Instead of using a rendered email document through the email option, we can use plain text here. However, if any email object is supplied then input to text is ignored.


Should the email message display it's own preview window? If TRUE (the default), the rendered email message will be shown in the default browser.


Since this function needs to be invoked within an R Markdown document, the chunk option echo=FALSE is useful here (so that viewers of the rendered document don't have to unnecessarily read code related to email inclusion). While the output is invisible, any errors related to rendering will be visible to the author.

blastula documentation built on Sept. 24, 2023, 1:07 a.m.