blastula not naming attachments correctly

138 Views Asked by At

I'm trying to send an email with an attachment (blastula v0.3.4) Everything's working except my attachments arrive called 'Filename' (no extension) instead of 'my_attachment.html'. The contents of the attachment are correct.

Here's my code:

library(tidyverse)
library(DT)
library(blastula)

output_file_body <- paste0(machine, "output/test_mailer_", Sys.Date(), ".html")

rmarkdown::render(paste0(machine, "R/emailbody.Rmd"),
                  output_file = output_file_body,
                  envir = new.env(globalenv())
)

email <- compose_email(
  body = md("Please see the attached HTML file for details.")
  ) %>%
  add_attachment(file = output_file_body, filename = 'my_attachment.html')  # Attach the HTML file

smtp_send(
  email = email,
  from = "[email protected]",
  to = c(
    "[email protected]",
    "[email protected]",
  ),
  subject = "Test Mailer",
  credentials = creds_file(paste0(machine, "no-reply"))

My .RmD is

---
title: testing
date: "`r Sys.Date()`"
output: 
  html_document:
    number_sections: true  
    center: true
    highlight: tango
    theme: spacelab
---
{r Global options, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
{r }
iris %>% DT::datatable()
0

There are 0 best solutions below