Add attachments to a message object
Examples
path_mtcars <- tempfile(fileext = ".csv")
path_scatter <- tempfile(fileext = ".png")
path_cats <- system.file("cats.jpg", package = "emayili")
write.csv(mtcars, path_mtcars)
png(path_scatter)
plot(1:10)
dev.off()
#> pdf
#> 2
msg <- envelope() %>%
attachment(path_mtcars) %>%
# This attachment will have file name "cats.jpg".
attachment(path_cats, name = "cats.jpg", type = "image/jpeg") %>%
attachment(path_scatter, cid = "scatter")
file.remove(path_scatter, path_mtcars)
#> [1] TRUE TRUE