add_attachment blastula not attaching

Hi guys, I've been trying to use Blastula to attach two csv files but the default add_attachment function is not working for me. If I check my email object the attachments item stays empty.

test <- "h:/test.txt"
add_attachment(
  email,
  test,
  content_type = mime::guess_type(test),
  filename = basename(test)
)

I run the underlying code of the function add_attachment

content_type = mime::guess_type(test)
filename = basename(test)
expanded_path <-
  test %>%
  path.expand() %>%
  normalizePath(mustWork = TRUE)
attachment_list <-
  list(
    file_path = expanded_path,
    content_type = content_type,
    disposition = "attachment",
    filename = filename
  )
email$attachments <- c(email$attachments, list(attachment_list))

my attachment is added. Any thoughts? Am I doing something wrong?

Found a similar thread but without an answer:

ok, found the problem. I had to write the output of the add_attachment function back into the email dataset.

test <- "h:/test.txt"
email <- add_attachment(
  email,
  test,
  content_type = mime::guess_type(test),
  filename = basename(test)
)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.