Search code examples
rr-markdownblastula

How to incorporate html file in body of Blastula email


I am using RMarkdown to generate html files weekly for reports I am making. I would like to be able to send the emails using Blastula incorporating the html file.

Currently, I can create an email object like the following:

email <- compose_email(body = md("Here is your report")) %>%
  add_attachment(myHTMLFile)

but I'd like to incorporate the html file within the body of the email. Is that possible?


Solution

  • I've had success incorporating glue while using Blastula.

    So your code might looks something like this:

    content_to_add <- read_file("myHTMLFile.html")
    
    email <- compose_email(body = md(glue("Here is your report.
                                          {content_to_add}")))