Add a local image inside the body of the email with this helper function.
add_image( file, alt = "", width = 520, align = c("center", "left", "right", "inline"), float = c("none", "left", "right") )
file | A path to an image file. |
---|---|
alt | Text description of image passed to the |
width | The width to be used for the image, in pixels. |
align | The alignment to be used for the image. If not |
float | The float value to be used for the image. If not |
A character object with an HTML fragment that can be placed inside the message body wherever the image should appear.
# Create an HTML fragment that # contains an image img_file_path <- system.file( "example_files", "test_image.png", package = "blastula" ) img_file_html <- add_image(file = img_file_path) # Include the image in the email # message body by simply referencing # the `img_file_html` object email <- compose_email( body = md( c( "Hello, Here is an image:\n", img_file_html ) ) ) if (interactive()) email